diff --git a/src/Draw.cpp b/src/Draw.cpp index 5b5c59f7..aeb680bc 100644 --- a/src/Draw.cpp +++ b/src/Draw.cpp @@ -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);