Merging with changes made by Florian Foster.
[collectd.git] / src / iptables.c
index 49454f0..806b7a4 100644 (file)
@@ -29,8 +29,6 @@
 #include "plugin.h"
 #include "configfile.h"
 
-#include <sys/socket.h>
-
 #include <libiptc/libiptc.h>
 #include <libiptc/libip6tc.h>
 
@@ -213,6 +211,7 @@ static int iptables_config (const char *key, const char *value)
                    char errbuf[1024];
                    ERROR ("realloc failed: %s",
                            sstrerror (errno, errbuf, sizeof (errbuf)));
+                   sfree (temp.rule.comment);
                    return (1);
                }
 
@@ -223,6 +222,7 @@ static int iptables_config (const char *key, const char *value)
                    char errbuf[1024];
                    ERROR ("malloc failed: %s",
                            sstrerror (errno, errbuf, sizeof (errbuf)));
+                   sfree (temp.rule.comment);
                    return (1);
                }
                memcpy (final, &temp, sizeof (temp));