diff --git a/bundle.json b/bundle.json index 27b6ca65cdedb32d4f870472e3fbc89bd317d2d4..9b7c615eeab1a728b9ebf10db24b22b948a8f541 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 5ccf6076c9da74061815d9c08b9cf1b6cd19c903..e8437b334bdbe064bd702ffbc861fefa3cbc6e2f 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;