From: Mark Andrews Date: Sun, 21 Feb 2021 22:44:56 +0000 (+1100) Subject: Address theoretical resource leak in dns_dt_open() X-Git-Tag: v9.17.11~36^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=003dd8cc700931509a6dfac4a4faab4084a2f085;p=thirdparty%2Fbind9.git Address theoretical resource leak in dns_dt_open() dns_dt_open() is not currently called with mode dns_dtmode_unix. *** CID 281489: Resource leaks (RESOURCE_LEAK) /lib/dns/dnstap.c: 983 in dns_dt_open() 977 978 if (!dnstap_file(handle->reader)) { 979 CHECK(DNS_R_BADDNSTAP); 980 } 981 break; 982 case dns_dtmode_unix: CID 281489: Resource leaks (RESOURCE_LEAK) Variable "handle" going out of scope leaks the storage it points to. 983 return (ISC_R_NOTIMPLEMENTED); 984 default: 985 INSIST(0); 986 ISC_UNREACHABLE(); 987 } 988 --- diff --git a/lib/dns/dnstap.c b/lib/dns/dnstap.c index 2688b30a338..56649f33c05 100644 --- a/lib/dns/dnstap.c +++ b/lib/dns/dnstap.c @@ -980,7 +980,8 @@ dns_dt_open(const char *filename, dns_dtmode_t mode, isc_mem_t *mctx, } break; case dns_dtmode_unix: - return (ISC_R_NOTIMPLEMENTED); + result = ISC_R_NOTIMPLEMENTED; + goto cleanup; default: INSIST(0); ISC_UNREACHABLE();