From 32f52ae23621e24d75de3cb5a3e3ab20677e5bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 29 Aug 2023 09:52:17 +0200 Subject: [PATCH] core: check that property is not NULL before calling free --- src/core/wee-eval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/wee-eval.c b/src/core/wee-eval.c index 81b4bd875..512961d0c 100644 --- a/src/core/wee-eval.c +++ b/src/core/wee-eval.c @@ -1272,7 +1272,8 @@ eval_hdata_get_value (struct t_hdata *hdata, void *pointer, const char *path, property = string_strndup (pos + 1, pos_open_paren - pos - 1); ptr_value = hashtable_get_string (hashtable, property); - free (property); + if (property) + free (property); value = (ptr_value) ? strdup (ptr_value) : NULL; break; }