Memory Leak found in file 'fuzz.c' in BIND-9.12.1-P2
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
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
Relevant logs and/or screenshots
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(rbuf); close(sockfd); close(listenfd); named_server_flushonshutdown(named_g_server, ISC_FALSE);