proper initialization and disposal of keying material

This commit is contained in:
Andreas Steffen
2009-01-15 01:52:44 +00:00
parent 182ebf85e6
commit b59f154b09
2 changed files with 8 additions and 3 deletions
+5 -2
View File
@@ -151,8 +151,11 @@ static inline void chunk_free(chunk_t *chunk)
*/
static inline void chunk_clear(chunk_t *chunk)
{
memset(chunk->ptr, 0, chunk->len);
chunk_free(chunk);
if (chunk->ptr)
{
memset(chunk->ptr, 0, chunk->len);
chunk_free(chunk);
}
}
/**