:: commit 0f4beb1bfd989b35a551073e6b22cc161aeac0d8

mintsuki <mintsuki@protonmail.com> — 2023-03-05 08:49

parents: 9d6c64954c

gterm: Fix NULL dereference bug when no wallpaper used

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;
tab: 248 wrap: offon