MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / cJSON_Delete

Function cJSON_Delete

lib/cJSON.c:215–236  ·  view source on GitHub ↗

Delete a cJSON structure. */

Source from the content-addressed store, hash-verified

213
214/* Delete a cJSON structure. */
215void cJSON_Delete(cJSON *c)
216{
217 cJSON *next;
218 while (c)
219 {
220 next = c->next;
221 if (!(c->type & cJSON_IsReference) && c->child)
222 {
223 cJSON_Delete(c->child);
224 }
225 if (!(c->type & cJSON_IsReference) && c->valuestring)
226 {
227 cJSON_free(c->valuestring);
228 }
229 if (!(c->type & cJSON_StringIsConst) && c->string)
230 {
231 cJSON_free(c->string);
232 }
233 cJSON_free(c);
234 c = next;
235 }
236}
237
238/* Parse the input text to generate a number, and populate the result into item. */
239static const unsigned char *parse_number(cJSON *item, const unsigned char *num)

Callers 15

cJSON_ParseWithOptsFunction · 0.70
parse_arrayFunction · 0.70
parse_objectFunction · 0.70
ReplaceItemInArrayFunction · 0.70
cJSON_CreateStringFunction · 0.70
cJSON_CreateStrFunction · 0.70
cJSON_CreateRawFunction · 0.70
cJSON_CreateIntArrayFunction · 0.70
cJSON_CreateFloatArrayFunction · 0.70
cJSON_CreateDoubleArrayFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected