]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4285 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 4 Jun 2012 14:24:42 +0000 (09:24 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 4 Jun 2012 14:24:42 +0000 (09:24 -0500)
src/switch_json.c

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