Set *subkey to NULL if key generation fails

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14455 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Luke Howard
2005-01-05 02:39:21 +00:00
parent 979a1a438b
commit 5bef70bc26

View File

@@ -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;
}