From 9e6ae0edc139c2c8a741c7127f4abf8ef2008985 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 9 May 2018 07:14:56 +0200 Subject: [PATCH] make str_strdup more forgiving --- src/util/strings.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/strings.c b/src/util/strings.c index 81fdc3713..ab85328ab 100644 --- a/src/util/strings.c +++ b/src/util/strings.c @@ -218,6 +218,7 @@ unsigned int wang_hash(unsigned int a) } char *str_strdup(const char *s) { + if (s == NULL) return NULL; #ifdef HAVE_STRDUP return strdup(s); #elif defined(_MSC_VER)