cJSON

mirror of Dave's cJSON
git clone git://git.thc420.xyz/cJSON
Log | Files | Refs | README | LICENSE

commit 702fd95af3408b157167bfd30728c66a212aeae7
parent 94117a5d239bd7686b485e2f820e79a522f0fd19
Author: Max Bruckner <max@maxbruckner.de>
Date:   Wed, 15 Feb 2017 20:45:23 +0100

fix #106: potentially invalid free in cJSON_AddItemToObject

Diffstat:
McJSON.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cJSON.c b/cJSON.c @@ -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); }