(krb5_rd_cred): avoid a memory leak on malloc failure, found by IBM checker.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16944 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-04-02 01:31:10 +00:00
parent d579ee0dc9
commit 1305bbe9d5

View File

@@ -257,8 +257,10 @@ krb5_rd_cred(krb5_context context,
ASN1_MALLOC_ENCODE(Ticket, creds->ticket.data, creds->ticket.length,
&cred.tickets.val[i], &len, ret);
if (ret)
if (ret) {
free(creds);
goto out;
}
if(creds->ticket.length != len)
krb5_abortx(context, "internal error in ASN.1 encoder");
copy_EncryptionKey (&kci->key, &creds->session);