Return NULL if argument is NULL.

This commit is contained in:
Yang Tse 2006-07-17 15:25:37 +00:00
parent 9c83a20a27
commit f72c4e82fd
1 changed files with 3 additions and 0 deletions

View File

@ -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)