From: Yousong Zhou Date: Mon, 14 Oct 2019 06:48:56 +0000 (+0000) Subject: exec: free up memory on shutdown X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2d62935910e0bbb871705113aed6f19d9ae205f2;p=collectd.git exec: free up memory on shutdown --- diff --git a/src/exec.c b/src/exec.c index 9574f2c4..a0e534c7 100644 --- a/src/exec.c +++ b/src/exec.c @@ -919,6 +919,11 @@ static int exec_shutdown(void) /* {{{ */ INFO("exec plugin: Sent SIGTERM to %hu", (unsigned short int)pl->pid); } + for (int i = 0; pl->argv[i] != NULL; i++) { + sfree(pl->argv[i]); + } + sfree(pl->argv); + sfree(pl->exec); sfree(pl->user); sfree(pl);