]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
A couple of more cleanups after free in opensslrsa_generate()
authorOndřej Surý <ondrej@sury.org>
Wed, 4 Apr 2018 12:25:10 +0000 (14:25 +0200)
committerMark Andrews <marka@isc.org>
Fri, 6 Apr 2018 04:27:23 +0000 (14:27 +1000)
(cherry picked from commit d2b3188c61d90aeabb05baf3f9bcd7f56cf33010)

lib/dns/opensslrsa_link.c

index 7bde6d8295e0920c6b93b4f61a5aab5ae7a671e8..837a114a6061da0cd72b14528961aba3e392afef 100644 (file)
@@ -1011,13 +1011,19 @@ opensslrsa_generate(dst_key_t *key, int exp, void (*callback)(int)) {
 
  err:
 #if USE_EVP
-       if (pkey != NULL)
+       if (pkey != NULL) {
                EVP_PKEY_free(pkey);
+               pkey = NULL;
+       }
 #endif
-       if (e != NULL)
+       if (e != NULL) {
                BN_free(e);
-       if (rsa != NULL)
+               e = NULL;
+       }
+       if (rsa != NULL) {
                RSA_free(rsa);
+               rsa = NULL;
+       }
        if (cb != NULL) {
                BN_GENCB_free(cb);
                cb = NULL;