From a28fb072c0452d0475ea4cd7714b6664b1f48c60 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 24 Mar 2020 02:52:35 +0100 Subject: [PATCH] Sanity checks in a part of video.c, per Ryuzaki's suggestion. --- src/video/video.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/video/video.c b/src/video/video.c index 0c4672086..d3ed0794b 100644 --- a/src/video/video.c +++ b/src/video/video.c @@ -776,9 +776,11 @@ set_palette(PALETTE p) void destroy_bitmap(bitmap_t *b) { - if (b->dat != NULL) + if ((b != NULL) && (b->dat != NULL)) free(b->dat); - free(b); + + if (b != NULL) + free(b); }