cJSON

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

commit eeb6d237b64a898c0d97f3fbac5dc8359fbb44de
parent e1eb06fae0365d1bb05a3297befe50a0e7e2811a
Author: Max Bruckner <max@maxbruckner.de>
Date:   Tue,  6 Dec 2016 08:36:47 +0700

Merge pull request #81 from alperakcan/master

fix memory leak in cJSON_Duplicate
Diffstat:
McJSON.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cJSON.c b/cJSON.c @@ -2153,7 +2153,7 @@ cJSON *cJSON_Duplicate(const cJSON *item, cjbool recurse) } if (item->string) { - newitem->string = cJSON_strdup(item->string); + newitem->string = (item->type&cJSON_StringIsConst) ? item->string : cJSON_strdup(item->string); if (!newitem->string) { cJSON_Delete(newitem);