pkcs15-prkey: Simplify cleaning memory after failure
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18478
This commit is contained in:
parent
19f4c7e428
commit
6ce6152284
|
@ -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);
|
r = sc_asn1_decode_choice(ctx, asn1_prkey, *buf, *buflen, buf, buflen);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
/* This might have allocated something. If so, clear it now */
|
/* This might have allocated something. If so, clear it now */
|
||||||
if (asn1_com_prkey_attr->flags & SC_ASN1_PRESENT &&
|
free(info.subject.value);
|
||||||
asn1_com_prkey_attr[0].flags & SC_ASN1_PRESENT) {
|
|
||||||
free(asn1_com_prkey_attr[0].parm);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (r == SC_ERROR_ASN1_END_OF_CONTENTS)
|
if (r == SC_ERROR_ASN1_END_OF_CONTENTS)
|
||||||
return r;
|
return r;
|
||||||
|
|
Loading…
Reference in New Issue