From c7cf41c357b8b8898696e7a433844ce75b4de89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 30 Oct 2023 12:13:55 +0100 Subject: [PATCH] core: fix use NULL pointer when a config file has no options --- src/core/wee-doc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/wee-doc.c b/src/core/wee-doc.c index 704c17f50..7d880ff83 100644 --- a/src/core/wee-doc.c +++ b/src/core/wee-doc.c @@ -602,10 +602,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);