Skip to content
Permalink
Browse files Browse the repository at this point in the history
pkcs15-prkey: Simplify cleaning memory after failure
  • Loading branch information
Jakuje authored and frankmorgner committed Oct 23, 2019
1 parent 19f4c7e commit 6ce6152
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/libopensc/pkcs15-prkey.c
Expand Up @@ -260,10 +260,7 @@ int sc_pkcs15_decode_prkdf_entry(struct sc_pkcs15_card *p15card,
r = sc_asn1_decode_choice(ctx, asn1_prkey, *buf, *buflen, buf, buflen);
if (r < 0) {
/* This might have allocated something. If so, clear it now */
if (asn1_com_prkey_attr->flags & SC_ASN1_PRESENT &&
asn1_com_prkey_attr[0].flags & SC_ASN1_PRESENT) {
free(asn1_com_prkey_attr[0].parm);
}
free(info.subject.value);
}
if (r == SC_ERROR_ASN1_END_OF_CONTENTS)
return r;
Expand Down

0 comments on commit 6ce6152

Please sign in to comment.