pkcs15-pubkey: Avoid memory leaks

Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18758
This commit is contained in:
Jakub Jelen 2019-11-06 13:52:49 +01:00 committed by Frank Morgner
parent cc917b541f
commit 0977b5496a
1 changed files with 3 additions and 0 deletions

View File

@ -311,6 +311,9 @@ int sc_pkcs15_decode_pukdf_entry(struct sc_pkcs15_card *p15card,
memset(gostr3410_params, 0, sizeof(gostr3410_params));
r = sc_asn1_decode(ctx, asn1_pubkey, *buf, *buflen, buf, buflen);
if (r < 0) {
free(der->value);
}
if (r == SC_ERROR_ASN1_END_OF_CONTENTS)
goto err;
LOG_TEST_GOTO_ERR(ctx, r, "ASN.1 decoding failed");