]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: mworker: Fix memory leak of mworker_proc members
authorTim Duesterhus <tim@bastelstu.be>
Thu, 16 May 2019 18:23:22 +0000 (20:23 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 22 May 2019 09:29:18 +0000 (11:29 +0200)
commit9b7a976cd6d2d8b42396f0aeb863c198ecb61cc4
treeb963634c0492b07ef3c09568f61c60eb22d8d5c0
parent80daaa1e9dbf0e9b5df5308bc72672f85f794700
BUG/MINOR: mworker: Fix memory leak of mworker_proc members

The struct mworker_proc is not uniformly freed everywhere, sometimes leading
to leaks of the `id` string (and possibly the other strings).

Introduce a mworker_free_child function instead of duplicating the freeing
logic everywhere to prevent this kind of issues.

This leak was reported in issue #96.

It looks like the leaks have been introduced in commit 9a1ee7ac31c56fd7d881adf2ef4659f336e50c9f,
which is specific to 2.0-dev. Backporting `mworker_free_child` might be
helpful to ease backporting other fixes, though.
include/proto/mworker.h
src/haproxy.c
src/mworker-prog.c
src/mworker.c