FS-4285 --resolve

This commit is contained in:
Anthony Minessale 2012-06-04 09:24:42 -05:00
parent 992e05667c
commit 6a7fe5411f
1 changed files with 3 additions and 2 deletions

View File

@ -50,10 +50,11 @@ static char* cJSON_strdup(const char* str)
{ {
size_t len; size_t len;
char* copy; char* copy;
const char *s = str ? str : "";
len = strlen(str) + 1; len = strlen(s) + 1;
if (!(copy = (char*)cJSON_malloc(len))) return 0; if (!(copy = (char*)cJSON_malloc(len))) return 0;
memcpy(copy,str,len); memcpy(copy,s,len);
return copy; return copy;
} }