From: Yousong Zhou Date: Mon, 14 Oct 2019 06:48:56 +0000 (+0000) Subject: exec: free up memory on shutdown X-Git-Tag: collectd-5.11.0~61^2~1 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=2d62935910e0bbb871705113aed6f19d9ae205f2;p=thirdparty%2Fcollectd.git exec: free up memory on shutdown --- diff --git a/src/exec.c b/src/exec.c index 9574f2c4b..a0e534c7d 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);