Memory Leak found in file 'fuzz.c' in BIND-9.12.1-P2
Summary
In reviewing source code in BIND-9.12.1-P2, in directory '/bin/named', file 'fuzz.c', in function 'static void *fuzz_thread_resolver', it would appear that variable 'rbuf' is never freed prior to the function returning cleanly (i.e. - buf is released by free, but rbuf is not).
Steps to reproduce
N/A
What is the current bug behavior?
With current code, a memory leak develops over time in file 'fuzz.c'
What is the expected correct behavior?
the memory allocated for rbuf should be released before the function returns.
Relevant configuration files
N/A
Relevant logs and/or screenshots
N/A
Possible fixes
Patch file is attached to this bug report and is listed below:
--- fuzz.c.orig 2018-07-09 20:32:05.765895918 -0700 +++ fuzz.c 2018-07-09 20:33:48.868144488 -0700 @@ -574,6 +574,7 @@ }
free(buf);
-
free(rbuf); close(sockfd); close(listenfd); named_server_flushonshutdown(named_g_server, ISC_FALSE);