From a7bd0604523b5b9374befbf8c7ebfc0ff6511b06 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Mon, 31 Oct 2016 20:09:44 +0100 Subject: [PATCH] Fix memory leak when loading png files. --- src/texture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/texture.cpp b/src/texture.cpp index 917a414..1ecb5e2 100644 --- a/src/texture.cpp +++ b/src/texture.cpp @@ -246,10 +246,10 @@ namespace cloonel { break; default: - png_destroy_read_struct(&pngptr, &infoptr, nullptr); retSurf = nullptr; } + png_destroy_read_struct(&pngptr, &infoptr, nullptr); return retSurf; }