Fix memory leaks

This commit is contained in:
Clownacy 2020-01-26 23:54:20 +00:00
parent 5e60c15b1d
commit cccef2b089

View file

@ -294,6 +294,8 @@ BOOL MakeSurface_File(const char *name, SurfaceID surf_no)
int width, height;
unsigned char *image_buffer = DecodeBitmap(data, size, &width, &height);
free(data);
if (image_buffer == NULL)
{
PrintBitmapError(path, 1);
@ -388,6 +390,8 @@ BOOL ReloadBitmap_File(const char *name, SurfaceID surf_no)
int width, height;
unsigned char *image_buffer = DecodeBitmap(data, size, &width, &height);
free(data);
if (image_buffer == NULL)
{
PrintBitmapError(path, 1);