mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
Return NULL if argument is NULL.
This commit is contained in:
parent
9c83a20a27
commit
f72c4e82fd
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user