]> 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)
committerOndřej Surý <ondrej@sury.org>
Wed, 4 Apr 2018 15:28:55 +0000 (17:28 +0200)
lib/dns/opensslrsa_link.c

index fd6add864ca72c9e7eb01a58105afd7aff66fe61..bdb0a3931d078780477bac288497a4c3da5ecda6 100644 (file)
@@ -1059,13 +1059,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;