:: commit edd4454b009390622c615aa61cd5f55c3e36411d

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

parents: 77cd8b085a

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