From: Jérémie Galarneau Date: Thu, 6 Dec 2018 20:49:04 +0000 (-0500) Subject: Fix: worker structure is leaked in run_as process X-Git-Tag: v2.11.0-rc2~117 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=547aabb4dd0e1c87d0f0caa01af583b0f9ce8194;p=lttng-tools.git Fix: worker structure is leaked in run_as process 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 --- diff --git a/src/common/runas.c b/src/common/runas.c index 7b1c8423d..b4a4ccdde 100644 --- a/src/common/runas.c +++ b/src/common/runas.c @@ -921,6 +921,8 @@ int run_as_create_worker_no_lock(const char *procname) ret = -1; } worker->sockpair[1] = -1; + free(worker->procname); + free(worker); LOG(ret ? PRINT_ERR : PRINT_DBG, "run_as worker exiting (ret = %d)", ret); exit(ret ? EXIT_FAILURE : EXIT_SUCCESS); } else {