Code

Assure that `sstrdup' works with NULL-pointers
authorocto <octo>
Fri, 10 Mar 2006 11:16:21 +0000 (11:16 +0000)
committerocto <octo>
Fri, 10 Mar 2006 11:16:21 +0000 (11:16 +0000)
src/common.c

index 43a51a57c5aa7db29ec401852d8919a66404611b..50a563a3ea41b95bb64e19c6451f749ec076313c 100644 (file)
@@ -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.");