]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Free 'n' on error path in rsa_check
authorMark Andrews <marka@isc.org>
Mon, 26 Sep 2022 02:05:33 +0000 (12:05 +1000)
committerMark Andrews <marka@isc.org>
Wed, 28 Sep 2022 00:06:39 +0000 (10:06 +1000)
(cherry picked from commit 483c5a19781b0930c6e72bb2b498130c3f83d13f)

lib/dns/opensslrsa_link.c

index b744a62df98ee3b98db99b338cddda9e9ff38ccd..9bee2f0449b8338b4b2dab62348d2f29086efd07 100644 (file)
@@ -852,6 +852,9 @@ rsa_check(RSA *rsa, RSA *pub) {
                }
                if (e1 != NULL) {
                        if (BN_cmp(e1, e2) != 0) {
+                               if (n != NULL) {
+                                       BN_free(n);
+                               }
                                return (DST_R_INVALIDPRIVATEKEY);
                        }
                } else {