(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:
@@ -257,8 +257,10 @@ krb5_rd_cred(krb5_context context,
|
|||||||
|
|
||||||
ASN1_MALLOC_ENCODE(Ticket, creds->ticket.data, creds->ticket.length,
|
ASN1_MALLOC_ENCODE(Ticket, creds->ticket.data, creds->ticket.length,
|
||||||
&cred.tickets.val[i], &len, ret);
|
&cred.tickets.val[i], &len, ret);
|
||||||
if (ret)
|
if (ret) {
|
||||||
|
free(creds);
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
if(creds->ticket.length != len)
|
if(creds->ticket.length != len)
|
||||||
krb5_abortx(context, "internal error in ASN.1 encoder");
|
krb5_abortx(context, "internal error in ASN.1 encoder");
|
||||||
copy_EncryptionKey (&kci->key, &creds->session);
|
copy_EncryptionKey (&kci->key, &creds->session);
|
||||||
|
Reference in New Issue
Block a user