json: Wipe memory in cJSON_Delete
* src/cJSON.c (cJSON_Delete): Wipe memory on deletion.
This commit is contained in:
parent
fdc07b3ddc
commit
4dd1d0abd3
@ -123,9 +123,15 @@ cJSON_Delete (cJSON * c)
|
||||
if (!(c->type & cJSON_IsReference) && c->child)
|
||||
cJSON_Delete (c->child);
|
||||
if (!(c->type & cJSON_IsReference) && c->valuestring)
|
||||
{
|
||||
wipememory (c->valuestring, strlen (c->valuestring));
|
||||
xfree (c->valuestring);
|
||||
}
|
||||
if (c->string)
|
||||
{
|
||||
wipememory (c->string, strlen (c->string));
|
||||
xfree (c->string);
|
||||
}
|
||||
xfree (c);
|
||||
c = next;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user