Commit f72c4e82 authored by Yang Tse's avatar Yang Tse
Browse files

Return NULL if argument is NULL.

parent 9c83a20a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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)