Fix memory leaks
This commit is contained in:
parent
5e60c15b1d
commit
cccef2b089
1 changed files with 4 additions and 0 deletions
|
@ -294,6 +294,8 @@ BOOL MakeSurface_File(const char *name, SurfaceID surf_no)
|
||||||
int width, height;
|
int width, height;
|
||||||
unsigned char *image_buffer = DecodeBitmap(data, size, &width, &height);
|
unsigned char *image_buffer = DecodeBitmap(data, size, &width, &height);
|
||||||
|
|
||||||
|
free(data);
|
||||||
|
|
||||||
if (image_buffer == NULL)
|
if (image_buffer == NULL)
|
||||||
{
|
{
|
||||||
PrintBitmapError(path, 1);
|
PrintBitmapError(path, 1);
|
||||||
|
@ -388,6 +390,8 @@ BOOL ReloadBitmap_File(const char *name, SurfaceID surf_no)
|
||||||
int width, height;
|
int width, height;
|
||||||
unsigned char *image_buffer = DecodeBitmap(data, size, &width, &height);
|
unsigned char *image_buffer = DecodeBitmap(data, size, &width, &height);
|
||||||
|
|
||||||
|
free(data);
|
||||||
|
|
||||||
if (image_buffer == NULL)
|
if (image_buffer == NULL)
|
||||||
{
|
{
|
||||||
PrintBitmapError(path, 1);
|
PrintBitmapError(path, 1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue