MCPcopy Index your code
hub / github.com/armink/struct2json / cJSON_Delete

Function cJSON_Delete

struct2json/src/cJSON.c:81–93  ·  view source on GitHub ↗

Delete a cJSON structure. */

Source from the content-addressed store, hash-verified

79
80/* Delete a cJSON structure. */
81void cJSON_Delete(cJSON *c)
82{
83 cJSON *next;
84 while (c)
85 {
86 next=c->next;
87 if (!(c->type&cJSON_IsReference) && c->child) cJSON_Delete(c->child);
88 if (!(c->type&cJSON_IsReference) && c->valuestring) cJSON_free(c->valuestring);
89 if (!(c->type&cJSON_StringIsConst) && c->string) cJSON_free(c->string);
90 cJSON_free(c);
91 c=next;
92 }
93}
94
95/* Parse the input text to generate a number, and populate the result into item. */
96static const char *parse_number(cJSON *item,const char *num)

Callers 5

cJSON_ParseWithOptsFunction · 0.85
cJSON_ReplaceItemInArrayFunction · 0.85
cJSON_DuplicateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected