Return NULL if argument is NULL.
This commit is contained in:
@@ -30,6 +30,9 @@ char *curlx_strdup(const char *str)
|
|||||||
int len;
|
int len;
|
||||||
char *newstr;
|
char *newstr;
|
||||||
|
|
||||||
|
if (!str)
|
||||||
|
return (char *)NULL;
|
||||||
|
|
||||||
len = strlen(str);
|
len = strlen(str);
|
||||||
newstr = (char *) malloc((len+1)*sizeof(char));
|
newstr = (char *) malloc((len+1)*sizeof(char));
|
||||||
if (!newstr)
|
if (!newstr)
|
||||||
|
Reference in New Issue
Block a user