From c0450f864325ddcb0b553d5dbeae44448a1d72a9 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sat, 31 Jan 2009 00:49:53 +0000 Subject: [PATCH] handle freeing null keyblock git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21846 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/keyblocks.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/crypto/keyblocks.c b/src/lib/crypto/keyblocks.c index 5e698cc5a..5912c81b4 100644 --- a/src/lib/crypto/keyblocks.c +++ b/src/lib/crypto/keyblocks.c @@ -69,11 +69,11 @@ krb5int_c_free_keyblock(krb5_context context, register krb5_keyblock *val) } void -krb5int_c_free_keyblock_contents(krb5_context context, register krb5_keyblock *key) +krb5int_c_free_keyblock_contents(krb5_context context, krb5_keyblock *key) { - if (key->contents) { - krb5int_zap_data (key->contents, key->length); - free(key->contents); - key->contents = 0; - } + if (key && key->contents) { + krb5int_zap_data (key->contents, key->length); + free(key->contents); + key->contents = 0; + } } -- 2.26.2