]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: mworker: fix memory leak due to master-worker fork
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Tue, 15 Oct 2024 10:39:50 +0000 (12:39 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Oct 2024 20:02:39 +0000 (22:02 +0200)
commitae84f060253f5ab01b3b20618f575a8df162c897
tree324f6431964e3a5c17f5a94e9c2419fd06ea11cd
parent8dd4efe42fc16e3ad3c734483c0e7cc1dc8e5bbe
BUG/MINOR: mworker: fix memory leak due to master-worker fork

Before this fix, startup logs ring was duplicated before the fork(), so master
and worker had both the original startup_logs ring and the duplicated one. In
the worker context we freed the original ring and used a duplicated one. In
the master context we did nothing, but we still create a duplicated copy again
and again during the reload.

So, let's duplicate startup logs ring only in the worker context. Master
continues to use the original ring initialized in init() before its fork().
src/haproxy.c