From 5bef70bc26a41717e99d0d49bb97d34a1d1dec5f Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Wed, 5 Jan 2005 02:39:21 +0000 Subject: [PATCH] Set *subkey to NULL if key generation fails git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14455 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/generate_subkey.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/krb5/generate_subkey.c b/lib/krb5/generate_subkey.c index 6bc2d2419..4f5af0882 100644 --- a/lib/krb5/generate_subkey.c +++ b/lib/krb5/generate_subkey.c @@ -62,8 +62,10 @@ krb5_generate_subkey_extended(krb5_context context, /* XXX should we use the session key as input to the RF? */ ret = krb5_generate_random_keyblock(context, etype, *subkey); - if(ret) + if (ret != 0) { free(*subkey); + *subkey = NULL; + } return ret; } -- 2.11.4.GIT