projects
/
curl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c83a20
)
Return NULL if argument is NULL.
author
Yang Tse
<yangsita@gmail.com>
Mon, 17 Jul 2006 15:25:37 +0000
(15:25 +0000)
committer
Yang Tse
<yangsita@gmail.com>
Mon, 17 Jul 2006 15:25:37 +0000
(15:25 +0000)
lib/strdup.c
patch
|
blob
|
history
diff --git
a/lib/strdup.c
b/lib/strdup.c
index a9ed448a8cc00b9c5b676f89595c32fb8f51f43a..e16e08a727749024ec612db9fea2e9888b30d148 100644
(file)
--- 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)