From f468121a1abec8c33d38712723f174a73229e68d Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 27 Jun 2008 03:20:48 +0000 Subject: [PATCH] When returning an error, don't also pass back an invalid pointer git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20484 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/old_api_glue.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/crypto/old_api_glue.c b/src/lib/crypto/old_api_glue.c index fda16909a..4db0c3359 100644 --- a/src/lib/crypto/old_api_glue.c +++ b/src/lib/crypto/old_api_glue.c @@ -147,8 +147,10 @@ krb5_random_key(krb5_context context, const krb5_encrypt_block *eblock, if ((key = (krb5_keyblock *) malloc(sizeof(krb5_keyblock))) == NULL) return(ENOMEM); - if ((ret = krb5_c_make_random_key(context, eblock->crypto_entry, key))) + if ((ret = krb5_c_make_random_key(context, eblock->crypto_entry, key))) { free(key); + key = NULL; + } *keyblock = key; -- 2.26.2