From 0f4beb1bfd989b35a551073e6b22cc161aeac0d8 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Sun, 5 Mar 2023 09:49:28 +0100 Subject: [PATCH] gterm: Fix NULL dereference bug when no wallpaper used --- common/lib/gterm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/lib/gterm.c b/common/lib/gterm.c index 523debec..b5016edc 100644 --- a/common/lib/gterm.c +++ b/common/lib/gterm.c @@ -804,8 +804,10 @@ no_load_font:; pmm_free(font, FONT_MAX); - image_close(background); - background = NULL; + if (background != NULL) { + image_close(background); + background = NULL; + } if (terms_i == 0) { return false;