]> 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>
Tue, 27 Sep 2022 23:49:04 +0000 (09:49 +1000)
(cherry picked from commit 483c5a19781b0930c6e72bb2b498130c3f83d13f)

lib/dns/opensslrsa_link.c

index c2b62afd347eb92b88db45d56d1864265e97306f..d01d0b03cbb6e1b24a6ddfd8f07e405d88704667 100644 (file)
@@ -994,6 +994,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 {