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 43a51a5..50a563a 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.");