| 27 | |
| 28 | void reset(cJSON *item); |
| 29 | void reset(cJSON *item) { |
| 30 | if ((item != NULL) && (item->child != NULL)) |
| 31 | { |
| 32 | cJSON_Delete(item->child); |
| 33 | } |
| 34 | if ((item->valuestring != NULL) && !(item->type & cJSON_IsReference)) |
| 35 | { |
| 36 | global_hooks.deallocate(item->valuestring); |
| 37 | } |
| 38 | if ((item->string != NULL) && !(item->type & cJSON_StringIsConst)) |
| 39 | { |
| 40 | global_hooks.deallocate(item->string); |
| 41 | } |
| 42 | |
| 43 | memset(item, 0, sizeof(cJSON)); |
| 44 | } |
| 45 | |
| 46 | char* read_file(const char *filename); |
| 47 | char* read_file(const char *filename) { |
no test coverage detected
searching dependent graphs…