mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-02-04 00:05:31 +03:00
Free data upon failure in LoadImage()
Otherwise, if SDL_CreateRGBSurfaceFrom() returned NULL, then this memory would be leaked.
This commit is contained in:
@@ -76,6 +76,7 @@ static SDL_Surface* LoadImage(const char *filename, bool noBlend = true, bool no
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
SDL_free(data);
|
||||||
fprintf(stderr,"Image not found: %s\n", filename);
|
fprintf(stderr,"Image not found: %s\n", filename);
|
||||||
SDL_assert(0 && "Image not found! See stderr.");
|
SDL_assert(0 && "Image not found! See stderr.");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user