From ed453a92045e824755c46dcc1cf6e1522f918dd7 Mon Sep 17 00:00:00 2001 From: octo Date: Fri, 10 Mar 2006 11:16:21 +0000 Subject: [PATCH] Assure that `sstrdup' works with NULL-pointers --- src/common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common.c b/src/common.c index 43a51a57..50a563a3 100644 --- a/src/common.c +++ b/src/common.c @@ -56,6 +56,9 @@ char *sstrdup (const char *s) { char *r; + if (s == NULL) + return (NULL); + if((r = strdup (s)) == NULL) { DBG ("Not enough memory."); -- 2.11.0