Fix memory leak when loading png files.

This commit is contained in:
King_DuckZ 2016-10-31 20:09:44 +01:00
parent 09299595fe
commit a7bd060452

View file

@ -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;
}