提交 b5d2db4d 编写于 作者: D Dave Gamble

print_object was calling free() rather than cJSON_free() under failure conditions!


git-svn-id: http://svn.code.sf.net/p/cjson/code@36 e3330c51-1366-4df0-8b21-3ccf24e3d50e
上级 6f51f007
......@@ -428,8 +428,8 @@ static char *print_object(cJSON *item,int depth,int fmt)
/* Handle failure */
if (fail)
{
for (i=0;i<numentries;i++) {if (names[i]) free(names[i]);if (entries[i]) free(entries[i]);}
free(names);free(entries);
for (i=0;i<numentries;i++) {if (names[i]) cJSON_free(names[i]);if (entries[i]) cJSON_free(entries[i]);}
cJSON_free(names);cJSON_free(entries);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册