]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Free 'rsa' if 'e' is NULL in opensslrsa_verify2
authorMark Andrews <marka@isc.org>
Mon, 26 Sep 2022 01:51:05 +0000 (11:51 +1000)
committerMark Andrews <marka@isc.org>
Tue, 27 Sep 2022 23:49:04 +0000 (09:49 +1000)
(cherry picked from commit a2b51ca6acae9e1c819e0d2e4aa1584b675c4cb7)

lib/dns/opensslrsa_link.c

index cf350610ba2c84581d179a545a64208ba2b6c80b..72a195f366a19424c7638dce6c965648d05d5af4 100644 (file)
@@ -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);