exec plugin: Avoid a warning when freeing meta data.
[collectd.git] / src / exec.c
index d2b2508..1f8a9ac 100644 (file)
@@ -23,6 +23,8 @@
  *   Peter Holik <peter at holik.at>
  **/
 
+#define _BSD_SOURCE /* For setgroups */
+
 #include "collectd.h"
 #include "common.h"
 #include "plugin.h"
@@ -728,7 +730,8 @@ static void *exec_notification_one (void *arg) /* {{{ */
   DEBUG ("exec plugin: Child %i exited with status %i.",
       pid, status);
 
-  plugin_notification_meta_free (n->meta);
+  if (n->meta != NULL)
+    plugin_notification_meta_free (n->meta);
   n->meta = NULL;
   sfree (arg);
   pthread_exit ((void *) 0);