From f9c6ce31f41b6db2d30e7141d3ea792d42d6b942 Mon Sep 17 00:00:00 2001 From: youbing54 Date: Mon, 22 Jul 2024 10:55:13 +0800 Subject: [PATCH] IssueNo: https://gitee.com/openharmony/third_party_cJSON/issues/IAEKV4 describe: Code synchronization Feature or Bugfix: Bugfix Binary Source:Yes Signed-off-by: youbing54 --- bundle.json | 6 +----- cJSON.c | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bundle.json b/bundle.json index 27b6ca6..9b7c615 100644 --- a/bundle.json +++ b/bundle.json @@ -14,11 +14,7 @@ "subsystem": "thirdparty", "syscap": [], "features": [], - "adapted_system_type": [ - "mini", - "small", - "standard" - ], + "adapted_system_type": [ "mini", "small", "standard" ], "rom": "", "ram": "", "deps": { diff --git a/cJSON.c b/cJSON.c index 5ccf607..e8437b3 100644 --- a/cJSON.c +++ b/cJSON.c @@ -275,10 +275,16 @@ CJSON_PUBLIC(void) cJSON_Delete(cJSON *item) if (!(item->type & cJSON_IsReference) && (item->valuestring != NULL)) { global_hooks.deallocate(item->valuestring); + item->valuestring = NULL; } if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) { global_hooks.deallocate(item->string); + item->string = NULL; + } + if (next == item) + { + break; } global_hooks.deallocate(item); item = next; -- Gitee