:: commit fb994e61c662177ae6c5aeb0892d15366e5c24ad

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

parents: ac34ec411f

limine: Fix NULL term dereference bug if gterm_init fails

diff --git a/common/protos/limine.c b/common/protos/limine.c
index 00d55127..6b38b876 100644
--- a/common/protos/limine.c
+++ b/common/protos/limine.c
@@ -754,8 +754,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