input_overlay_free_overlay - prevent 'free' on not malloced pointer

This commit is contained in:
twinaphex 2015-07-11 22:07:05 +02:00
parent 17024c4056
commit 396b08513a

View File

@ -286,8 +286,12 @@ static void input_overlay_free_overlay(struct overlay *overlay)
for (i = 0; i < overlay->size; i++)
texture_image_free(&overlay->descs[i].image);
free(overlay->load_images);
free(overlay->descs);
if (overlay->load_images)
free(overlay->load_images);
overlay->load_images = NULL;
if (overlay->descs)
free(overlay->descs);
overlay->descs = NULL;
texture_image_free(&overlay->image);
}