From: Tim Duesterhus Date: Tue, 26 Apr 2022 21:35:07 +0000 (+0200) Subject: CLEANUP: Destroy `http_err_chunks` members during deinit X-Git-Tag: v2.6-dev8~60 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2b7fa9d6684c8990a40bc0a730f040cfb9f44744;p=thirdparty%2Fhaproxy.git CLEANUP: Destroy `http_err_chunks` members during deinit To make the deinit function a proper inverse of the init function we need to free the `http_err_chunks`: ==252081== 311,296 bytes in 19 blocks are still reachable in loss record 50 of 50 ==252081== at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==252081== by 0x2727EE: http_str_to_htx (http_htx.c:914) ==252081== by 0x272E60: http_htx_init (http_htx.c:1059) ==252081== by 0x26AC87: check_config_validity (cfgparse.c:4170) ==252081== by 0x155DFE: init (haproxy.c:2120) ==252081== by 0x155DFE: main (haproxy.c:3037) --- diff --git a/src/http_htx.c b/src/http_htx.c index d9584abaea..ea4c25f1ac 100644 --- a/src/http_htx.c +++ b/src/http_htx.c @@ -1112,6 +1112,9 @@ static void http_htx_deinit(void) LIST_DELETE(&http_rep->list); release_http_reply(http_rep); } + + for (rc = 0; rc < HTTP_ERR_SIZE; rc++) + chunk_destroy(&http_err_chunks[rc]); } REGISTER_CONFIG_POSTPARSER("http_htx", http_htx_init);