1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-01 10:33:32 +02:00

Free data upon failure in LoadImage()

Otherwise, if SDL_CreateRGBSurfaceFrom() returned NULL, then this memory
would be leaked.
This commit is contained in:
Misa 2021-01-13 22:56:19 -08:00 committed by Ethan Lee
parent 626aac59fb
commit adbab6355b

View File

@ -76,6 +76,7 @@ static SDL_Surface* LoadImage(const char *filename, bool noBlend = true, bool no
}
else
{
SDL_free(data);
fprintf(stderr,"Image not found: %s\n", filename);
SDL_assert(0 && "Image not found! See stderr.");
return NULL;