From ea018644f27efd6fdc11ee5fc9b5939a890a0f64 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Fri, 31 Jan 2025 12:37:08 +0100 Subject: [PATCH] skipping strdup on NULL string param --- src/core/lib/utils/memory.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/lib/utils/memory.c b/src/core/lib/utils/memory.c index 31e5612..fa425c9 100644 --- a/src/core/lib/utils/memory.c +++ b/src/core/lib/utils/memory.c @@ -166,6 +166,8 @@ void *why2_recalloc(void *pointer, unsigned long size, unsigned long block_size) char *why2_strdup(char *string) { + if (string == NULL) return NULL; + char *allocated = strdup(string); push_to_list(allocated, ALLOCATION);