]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: haproxy: Free uri_auth->scope during deinit
authorTim Duesterhus <tim@bastelstu.be>
Thu, 10 Sep 2020 17:46:38 +0000 (19:46 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 11 Sep 2020 05:54:39 +0000 (07:54 +0200)
commit00f00cf8fdca5d3f5d092b600023a9ef6611fe1b
treecf7c0f4b2a089109cba887b6f91c0238b3e6faca
parent022e5e56ed828a87a7b59a38032e48d3d11ba7a7
BUG/MINOR: haproxy: Free uri_auth->scope during deinit

Given the following example configuration:

    listen http
     bind *:80
     mode http
     stats scope .

Running a configuration check with valgrind reports:

    ==16341== 26 (24 direct, 2 indirect) bytes in 1 blocks are definitely lost in loss record 3 of 13
    ==16341==    at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==16341==    by 0x571C2E: stats_add_scope (uri_auth.c:296)
    ==16341==    by 0x46CE29: cfg_parse_listen (cfgparse-listen.c:1901)
    ==16341==    by 0x45A112: readcfgfile (cfgparse.c:2078)
    ==16341==    by 0x50A0F5: init (haproxy.c:1828)
    ==16341==    by 0x418248: main (haproxy.c:3012)

After this patch is applied the leak is gone as expected.

This is a very minor leak that can only be observed if deinit() is called,
shortly before the OS will free all memory of the process anyway. No
backport needed.
src/haproxy.c