From: Ondřej Surý Date: Wed, 4 Apr 2018 12:25:10 +0000 (+0200) Subject: A couple of more cleanups after free in opensslrsa_generate() X-Git-Tag: v9.13.0~76^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d2b3188c61d90aeabb05baf3f9bcd7f56cf33010;p=thirdparty%2Fbind9.git A couple of more cleanups after free in opensslrsa_generate() --- diff --git a/lib/dns/opensslrsa_link.c b/lib/dns/opensslrsa_link.c index fd6add864ca..bdb0a3931d0 100644 --- a/lib/dns/opensslrsa_link.c +++ b/lib/dns/opensslrsa_link.c @@ -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;