mirror of
https://github.com/curl/curl.git
synced 2026-05-03 22:27:51 +03:00
Return NULL if argument is NULL.
This commit is contained in:
parent
9c83a20a27
commit
f72c4e82fd
1 changed files with 3 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue