From 61c280a73539acbe68bb203ea8f09cf52cf4b784 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Mon, 19 Sep 2011 00:34:48 +0000 Subject: In pkinit_crypto_openssl.c, modified pkinit_octetstring2key() to eliminate a possible memory leak in the error path, where the key_block->length was set to zero but the key_block->contents were not freed. Also, changed calloc() call to a malloc() call to avoid allocating up to 8 times as much buffer space as needed. In keyblocks.c, modified kr5_free_keyblock_contents() to set the key->length to zero after the key->contents have been freed. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25189 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/krb/keyblocks.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/lib') diff --git a/src/lib/crypto/krb/keyblocks.c b/src/lib/crypto/krb/keyblocks.c index 21faa56311..98696f5086 100644 --- a/src/lib/crypto/krb/keyblocks.c +++ b/src/lib/crypto/krb/keyblocks.c @@ -68,6 +68,7 @@ krb5int_c_free_keyblock_contents(krb5_context context, krb5_keyblock *key) if (key && key->contents) { zapfree(key->contents, key->length); key->contents = NULL; + key->length = 0; } } -- cgit