aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/af_packet/af_packet.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/af_packet/af_packet.c b/src/plugins/af_packet/af_packet.c
index 7ff30e0a722..69245429918 100644
--- a/src/plugins/af_packet/af_packet.c
+++ b/src/plugins/af_packet/af_packet.c
@@ -821,13 +821,15 @@ error:
close (fd2);
fd2 = -1;
}
- vec_foreach_index (i, apif->fds)
- if (apif->fds[i] != -1)
- close (apif->fds[i]);
- vec_free (apif->fds);
+
vec_free (host_if_name_dup);
+
if (apif)
{
+ vec_foreach_index (i, apif->fds)
+ if (apif->fds[i] != -1)
+ close (apif->fds[i]);
+ vec_free (apif->fds);
memset (apif, 0, sizeof (*apif));
pool_put (apm->interfaces, apif);
}