MCPcopy Create free account
hub / github.com/OpenIPC/firmware / cJSON_Delete

Function cJSON_Delete

general/package/xmdp/src/cjson/cJSON.c:249–270  ·  view source on GitHub ↗

Delete a cJSON structure. */

Source from the content-addressed store, hash-verified

247
248/* Delete a cJSON structure. */
249CJSON_PUBLIC(void) cJSON_Delete(cJSON *item)
250{
251 cJSON *next = NULL;
252 while (item != NULL)
253 {
254 next = item->next;
255 if (!(item->type & cJSON_IsReference) && (item->child != NULL))
256 {
257 cJSON_Delete(item->child);
258 }
259 if (!(item->type & cJSON_IsReference) && (item->valuestring != NULL))
260 {
261 global_hooks.deallocate(item->valuestring);
262 }
263 if (!(item->type & cJSON_StringIsConst) && (item->string != NULL))
264 {
265 global_hooks.deallocate(item->string);
266 }
267 global_hooks.deallocate(item);
268 item = next;
269 }
270}
271
272/* get the decimal point character of the current locale */
273static unsigned char get_decimal_point(void)

Callers 15

scanFunction · 0.85
netip_connectFunction · 0.85
parse_arrayFunction · 0.85
parse_objectFunction · 0.85
cJSON_AddNullToObjectFunction · 0.85
cJSON_AddTrueToObjectFunction · 0.85
cJSON_AddFalseToObjectFunction · 0.85
cJSON_AddBoolToObjectFunction · 0.85
cJSON_AddNumberToObjectFunction · 0.85
cJSON_AddStringToObjectFunction · 0.85
cJSON_AddRawToObjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected