summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-09-15 01:11:43 +0300
committerAndrei Karas <akaras@inbox.ru>2013-09-15 01:11:43 +0300
commit4206ffda4d2acd238c8f0093345af0431cf8a863 (patch)
tree637833a1af325eddea5c1f3c1329f0f84355df27
parent57288890689bfa2c2d35882169a539813be621f1 (diff)
downloadmanaverse-4206ffda4d2acd238c8f0093345af0431cf8a863.tar.gz
manaverse-4206ffda4d2acd238c8f0093345af0431cf8a863.tar.bz2
manaverse-4206ffda4d2acd238c8f0093345af0431cf8a863.tar.xz
manaverse-4206ffda4d2acd238c8f0093345af0431cf8a863.zip
fix possible memory leak if image is not image.
-rw-r--r--src/resources/imagehelper.cpp1
1 files changed, 1 insertions, 0 deletions
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);