mirror of
https://github.com/akheron/jansson.git
synced 2025-04-05 13:35:05 +00:00
doc: Set all memory to zero in secure_free
This commit is contained in:
parent
e4d6a9f6f4
commit
67a7bc7376
2 changed files with 2 additions and 2 deletions
|
@ -1476,7 +1476,7 @@ JSON structures by zeroing all memory when freed::
|
|||
ptr -= 8;
|
||||
size = *((size_t *)ptr);
|
||||
|
||||
guaranteed_memset(ptr, 0, size);
|
||||
guaranteed_memset(ptr, 0, size + 8);
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ static void secure_free(void *ptr)
|
|||
ptr = (char *)ptr - 8;
|
||||
size = *((size_t *)ptr);
|
||||
|
||||
/*guaranteed_*/memset(ptr, 0, size);
|
||||
/*guaranteed_*/memset(ptr, 0, size + 8);
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue