From 9a642a3f53dfc3deab8196945d0b3762f4641200 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 6 Dec 2018 15:49:04 -0500 Subject: [PATCH] Fix: worker structure is leaked in run_as process MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The run_as structure (handle) is allocated and initialized before the fork() that spawns the run_as process. Currently, that structure is only cleaned-up on the parent's end. This fix performs the clean-up on the worker's side as well. Signed-off-by: Jérémie Galarneau --- src/common/runas.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/runas.c b/src/common/runas.c index f753d2454..9e3b5ec33 100644 --- a/src/common/runas.c +++ b/src/common/runas.c @@ -656,6 +656,7 @@ int run_as_create_worker(char *procname) ret = -1; } worker->sockpair[1] = -1; + free(worker); LOG(ret ? PRINT_ERR : PRINT_DBG, "run_as worker exiting (ret = %d)", ret); exit(ret ? EXIT_FAILURE : EXIT_SUCCESS); } else { -- 2.34.1