From 0fadd930116788b02cffb2fa175d8fd0756667c1 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 9 Nov 2011 17:32:14 +0100 Subject: [PATCH] Fix an invalid free in bpf code. --- src/runmode-pcap.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/runmode-pcap.c b/src/runmode-pcap.c index 435337c0a6..1460a70f79 100644 --- a/src/runmode-pcap.c +++ b/src/runmode-pcap.c @@ -71,9 +71,6 @@ void PcapDerefConfig(void *conf) PcapIfaceConfig *pfp = (PcapIfaceConfig *)conf; /* Pcap config is used only once but cost of this low. */ if (SC_ATOMIC_SUB(pfp->ref, 1) == 0) { - if (pfp->bpf_filter) { - SCFree(pfp->bpf_filter); - } SCFree(pfp); } } @@ -140,8 +137,7 @@ void *ParsePcapConfig(const char *iface) if (ConfGetChildValue(if_root, "bpf-filter", &tmpbpf) != 1) { SCLogDebug("could not get bpf or none specified"); } else { - /* TODO free this */ - aconf->bpf_filter = SCStrdup(tmpbpf); + aconf->bpf_filter = tmpbpf; } } else { SCLogInfo("BPF filter set from command line or via old 'bpf-filter' option.");