diff options
author | Andre Heinecke <[email protected]> | 2018-08-08 12:27:24 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2018-08-08 12:27:24 +0000 |
commit | 4dd1d0abd34a382d1cd67cabb737950a39cb3fdc (patch) | |
tree | 9e53cc3a4cc070dd023296a3ff1c7ec81bf31641 | |
parent | json: Only use calloc instead of malloc (diff) | |
download | gpgme-4dd1d0abd34a382d1cd67cabb737950a39cb3fdc.tar.gz gpgme-4dd1d0abd34a382d1cd67cabb737950a39cb3fdc.zip |
json: Wipe memory in cJSON_Delete
* src/cJSON.c (cJSON_Delete): Wipe memory on deletion.
-rw-r--r-- | src/cJSON.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/cJSON.c b/src/cJSON.c index 4da03ccc..9e53012e 100644 --- a/src/cJSON.c +++ b/src/cJSON.c @@ -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) - xfree (c->valuestring); + { + wipememory (c->valuestring, strlen (c->valuestring)); + xfree (c->valuestring); + } if (c->string) - xfree (c->string); + { + wipememory (c->string, strlen (c->string)); + xfree (c->string); + } xfree (c); c = next; } |