From 4206ffda4d2acd238c8f0093345af0431cf8a863 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 15 Sep 2013 01:11:43 +0300 Subject: fix possible memory leak if image is not image. --- src/resources/imagehelper.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/resources') diff --git a/src/resources/imagehelper.cpp b/src/resources/imagehelper.cpp index c94016ca1..2eb374bd4 100644 --- a/src/resources/imagehelper.cpp +++ b/src/resources/imagehelper.cpp @@ -129,6 +129,7 @@ SDL_Surface *ImageHelper::loadPng(SDL_RWops *const rw) if (!IMG_isPNG(rw)) { logger->log("Error, image is not png"); + SDL_RWclose(rw); return nullptr; } SDL_Surface *const tmpImage = MIMG_LoadPNG_RW(rw); -- cgit v1.2.3-60-g2f50