From 2b7fa9d6684c8990a40bc0a730f040cfb9f44744 Mon Sep 17 00:00:00 2001 From: Tim Duesterhus Date: Tue, 26 Apr 2022 23:35:07 +0200 Subject: [PATCH] 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) --- src/http_htx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/http_htx.c b/src/http_htx.c index d9584abae..ea4c25f1a 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);