]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: deinit: release the pre-check callbacks
authorWilly Tarreau <w@1wt.eu>
Wed, 27 Apr 2022 16:02:54 +0000 (18:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 27 Apr 2022 16:02:54 +0000 (18:02 +0200)
The freeing of pre-check callbacks was missing when this feature was
recently added with commit b53eb8790 ("MINOR: init: add the pre-check
callback"), let's do it to make valgrind happy.

src/haproxy.c

index b43997b6c5c87f955d511c13309a1d36eac47f6f..4ae694e8c25ee044c4b2236a5724e49fd40dca8a 100644 (file)
@@ -2557,6 +2557,7 @@ void deinit(void)
        struct post_server_check_fct *pscf, *pscfb;
        struct post_check_fct *pcf, *pcfb;
        struct post_proxy_check_fct *ppcf, *ppcfb;
+       struct pre_check_fct *prcf, *prcfb;
        int cur_fd;
 
        /* At this point the listeners state is weird:
@@ -2712,6 +2713,11 @@ void deinit(void)
                free(ppcf);
        }
 
+       list_for_each_entry_safe(prcf, prcfb, &pre_check_list, list) {
+               LIST_DELETE(&prcf->list);
+               free(prcf);
+       }
+
        list_for_each_entry_safe(tif, tifb, &per_thread_init_list, list) {
                LIST_DELETE(&tif->list);
                free(tif);