From: Mark Andrews Date: Mon, 26 Sep 2022 01:51:05 +0000 (+1000) Subject: Free 'rsa' if 'e' is NULL in opensslrsa_verify2 X-Git-Tag: v9.18.8~13^2~5 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=e9b880f64896a235ccca52a8fc9801cdb6f915a9;p=thirdparty%2Fbind9.git Free 'rsa' if 'e' is NULL in opensslrsa_verify2 (cherry picked from commit a2b51ca6acae9e1c819e0d2e4aa1584b675c4cb7) --- diff --git a/lib/dns/opensslrsa_link.c b/lib/dns/opensslrsa_link.c index cf350610ba2..72a195f366a 100644 --- a/lib/dns/opensslrsa_link.c +++ b/lib/dns/opensslrsa_link.c @@ -202,6 +202,7 @@ opensslrsa_verify2(dst_context_t *dctx, int maxbits, const isc_region_t *sig) { } RSA_get0_key(rsa, NULL, &e, NULL); if (e == NULL) { + RSA_free(rsa); return (dst__openssl_toresult(DST_R_VERIFYFAILURE)); } bits = BN_num_bits(e);