From: Yang Tse Date: Mon, 17 Jul 2006 15:25:37 +0000 (+0000) Subject: Return NULL if argument is NULL. X-Git-Tag: curl-7_15_5~90 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f72c4e82fd4155eb108d61a17d314d391e4f7730;p=thirdparty%2Fcurl.git Return NULL if argument is NULL. --- diff --git a/lib/strdup.c b/lib/strdup.c index a9ed448a8c..e16e08a727 100644 --- a/lib/strdup.c +++ b/lib/strdup.c @@ -30,6 +30,9 @@ char *curlx_strdup(const char *str) int len; char *newstr; + if (!str) + return (char *)NULL; + len = strlen(str); newstr = (char *) malloc((len+1)*sizeof(char)); if (!newstr)