:: commit f5d6ea44a21a0e39e9251741fc02a6bfd03f28a8

mintsuki <mintsuki@protonmail.com> — 2022-10-06 01:24

parents: b5fa979581

limine: Fix NULL term dereference bug if gterm_init fails

diff --git a/common/protos/limine.c b/common/protos/limine.c
index d6707249..78c32297 100644
--- a/common/protos/limine.c
+++ b/common/protos/limine.c
@@ -551,8 +551,10 @@ term_fail:
     goto skip_fb_init;
 FEAT_END
 
-    term->deinit(term, pmm_free);
-    term = NULL;
+    if (term != NULL) {
+        term->deinit(term, pmm_free);
+        term = NULL;
+    }
 
     if (!fb_init(&fb, req_width, req_height, req_bpp)) {
         goto no_fb;
tab: 248 wrap: offon