]> jfr.im git - irc/weechat/weechat.git/commitdiff
core: fix use NULL pointer when a config file has no options
authorSébastien Helleu <redacted>
Mon, 30 Oct 2023 11:13:55 +0000 (12:13 +0100)
committerSébastien Helleu <redacted>
Mon, 30 Oct 2023 22:10:54 +0000 (23:10 +0100)
src/core/wee-doc.c

index c6f008b74ac29145a96c62d9cd277cd49f08b0c4..dd84a8ece7e0330fb68af9354df82e7735bc6b09 100644 (file)
@@ -598,10 +598,13 @@ doc_gen_user_options (const char *path, const char *lang)
             free (default_value);
     }
 
-    string_fprintf (
-        file,
-        "// end::%s_options[]\n",
-        old_config->name);
+    if (old_config)
+    {
+        string_fprintf (
+            file,
+            "// end::%s_options[]\n",
+            old_config->name);
+    }
 
     arraylist_free (list_options);