pkcs15-cert: Avoid memory leaks
Thanks oss-fuzz https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24056
This commit is contained in:
parent
777a9e0386
commit
460a862ee0
@ -108,7 +108,6 @@ parse_x509_cert(sc_context_t *ctx, struct sc_pkcs15_der *der, struct sc_pkcs15_c
|
||||
if (!pubkey)
|
||||
LOG_TEST_GOTO_ERR(ctx, SC_ERROR_INVALID_ASN1_OBJECT, "Unable to decode subjectPublicKeyInfo from cert");
|
||||
|
||||
sc_asn1_clear_algorithm_id(&sig_alg);
|
||||
|
||||
if (serial && serial_len) {
|
||||
sc_format_asn1_entry(asn1_serial_number + 0, serial, &serial_len, 1);
|
||||
@ -129,6 +128,8 @@ parse_x509_cert(sc_context_t *ctx, struct sc_pkcs15_der *der, struct sc_pkcs15_c
|
||||
}
|
||||
|
||||
err:
|
||||
/* not used for anything */
|
||||
sc_asn1_clear_algorithm_id(&sig_alg);
|
||||
free(serial);
|
||||
free(subject);
|
||||
free(issuer);
|
||||
|
Loading…
Reference in New Issue
Block a user