(krb5_generate_subkey): check return value from malloc

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5938 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-04-11 22:49:16 +00:00
parent e52bd4e867
commit 5457b0d6ae

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 1998 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997, 1998, 1999 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -46,7 +46,10 @@ krb5_generate_subkey(krb5_context context,
krb5_keyblock **subkey)
{
krb5_error_code ret;
ALLOC(*subkey, 1);
if (*subkey == NULL)
return ENOMEM;
ret = krb5_generate_random_keyblock(context, key->keytype, *subkey);
if(ret)
free(*subkey);