提交 702fd95a 编写于 作者: M Max Bruckner

fix #106: potentially invalid free in cJSON_AddItemToObject

上级 94117a5d
......@@ -1771,7 +1771,7 @@ void cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item)
}
/* free old key and set new one */
if (item->string)
if (!(item->type & cJSON_StringIsConst) && item->string)
{
cJSON_free(item->string);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册