strdup(0) now returns 0
authorTheodore Tso <tytso@mit.edu>
Tue, 9 Jun 1992 14:57:05 +0000 (14:57 +0000)
committerTheodore Tso <tytso@mit.edu>
Tue, 9 Jun 1992 14:57:05 +0000 (14:57 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2285 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/posix/strdup.c

index ed212416489a32d5185ac2a46443f7f2532b148d..838572090444488bc62396e9cf7365bcd7ae3a5b 100644 (file)
@@ -31,6 +31,8 @@ strdup(str)
        int len;
        char *copy;
 
+       if (!str)
+               return((char *)0);
        len = strlen(str) + 1;
        if (!(copy = malloc((u_int)len)))
                return((char *)0);