]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Cleanup OpenSSL reference on bad option
authorMark Andrews <marka@isc.org>
Mon, 30 Jan 2023 04:26:52 +0000 (15:26 +1100)
committerMark Andrews <marka@isc.org>
Thu, 16 Feb 2023 22:31:52 +0000 (22:31 +0000)
Another exit path that needs to be cleaned up.

(cherry picked from commit e27fc4bbc54eaa2db3f3d12b871f8d7dc32298a8)

bin/dig/dig.c
bin/dig/dighost.c
bin/dig/dighost.h

index 9ff8b4292c1a91a1eea400dfb17a77a1ad4ed290..83eb8d1507a91e00d16397aeb08b919206ce9d1d 100644 (file)
@@ -2207,6 +2207,7 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
 
 #if !TARGET_OS_IPHONE
 exit_or_usage:
+       cleanup_openssl_refs();
        digexit();
 #endif /* if !TARGET_OS_IPHONE */
 }
index 7e46afa9e46d3fd3020018a75c40e7337c93f94b..f2a897dc05cb49bb770c968d7d95dac4aa0d027a 100644 (file)
@@ -247,9 +247,6 @@ clear_current_lookup(void);
 static bool
 next_origin(dig_lookup_t *oldlookup);
 
-static void
-cleanup_openssl_refs(void);
-
 static int
 count_dots(char *string) {
        char *s;
@@ -4712,7 +4709,7 @@ cancel_all(void) {
        UNLOCK_LOOKUP;
 }
 
-static void
+void
 cleanup_openssl_refs(void) {
        if (tsigkey != NULL) {
                debug("freeing TSIG key %p", tsigkey);
index 593468a049ba9692904bcf948ac313bcc9e1476b..227c315f513c402962a79c30e6dcfba95827352f 100644 (file)
@@ -295,6 +295,9 @@ warn(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
 noreturn void
 digexit(void);
 
+void
+cleanup_openssl_refs(void);
+
 void
 debug(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);