projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
exec: free up memory on shutdown
[collectd.git]
/
src
/
exec.c
diff --git
a/src/exec.c
b/src/exec.c
index
26b8fa7
..
a0e534c
100644
(file)
--- a/
src/exec.c
+++ b/
src/exec.c
@@
-28,11
+28,11
@@
#include "collectd.h"
#include "collectd.h"
-#include "common.h"
#include "plugin.h"
#include "plugin.h"
+#include "utils/common/common.h"
-#include "utils
_cmd_
putnotif.h"
-#include "utils
_cmd_
putval.h"
+#include "utils
/cmds/
putnotif.h"
+#include "utils
/cmds/
putval.h"
#include <grp.h>
#include <pwd.h>
#include <grp.h>
#include <pwd.h>
@@
-754,8
+754,9
@@
static void *exec_notification_one(void *arg) /* {{{ */
else if (n->severity == NOTIF_OKAY)
severity = "OKAY";
else if (n->severity == NOTIF_OKAY)
severity = "OKAY";
- fprintf(fh, "Severity: %s\n"
- "Time: %.3f\n",
+ fprintf(fh,
+ "Severity: %s\n"
+ "Time: %.3f\n",
severity, CDTIME_T_TO_DOUBLE(n->time));
/* Print the optional fields */
severity, CDTIME_T_TO_DOUBLE(n->time));
/* Print the optional fields */
@@
-918,6
+919,11
@@
static int exec_shutdown(void) /* {{{ */
INFO("exec plugin: Sent SIGTERM to %hu", (unsigned short int)pl->pid);
}
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);
sfree(pl->user);
sfree(pl);