exec plugin: Avoid a warning when freeing meta data.
[collectd.git] / src / exec.c
index 82aeb29..1f8a9ac 100644 (file)
@@ -1,6 +1,8 @@
 /**
  * collectd - src/exec.c
- * Copyright (C) 2007,2008  Florian octo Forster
+ * Copyright (C) 2007-2009  Florian octo Forster
+ * Copyright (C) 2007-2009  Sebastian Harl
+ * Copyright (C) 2008       Peter Holik
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
  *
  * Authors:
  *   Florian octo Forster <octo at verplant.org>
+ *   Sebastian Harl <sh at tokkee.org>
+ *   Peter Holik <peter at holik.at>
  **/
 
+#define _BSD_SOURCE /* For setgroups */
+
 #include "collectd.h"
 #include "common.h"
 #include "plugin.h"
@@ -724,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);