Delete a cJSON structure. */
| 213 | |
| 214 | /* Delete a cJSON structure. */ |
| 215 | void 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. */ |
| 239 | static const unsigned char *parse_number(cJSON *item, const unsigned char *num) |
no outgoing calls
no test coverage detected