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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user