Fix an invalid free in bpf code.

remotes/origin/master-1.1.x
Victor Julien 15 years ago
parent ea53f72f7d
commit 0fadd93011

@ -71,9 +71,6 @@ void PcapDerefConfig(void *conf)
PcapIfaceConfig *pfp = (PcapIfaceConfig *)conf; PcapIfaceConfig *pfp = (PcapIfaceConfig *)conf;
/* Pcap config is used only once but cost of this low. */ /* Pcap config is used only once but cost of this low. */
if (SC_ATOMIC_SUB(pfp->ref, 1) == 0) { if (SC_ATOMIC_SUB(pfp->ref, 1) == 0) {
if (pfp->bpf_filter) {
SCFree(pfp->bpf_filter);
}
SCFree(pfp); SCFree(pfp);
} }
} }
@ -140,8 +137,7 @@ void *ParsePcapConfig(const char *iface)
if (ConfGetChildValue(if_root, "bpf-filter", &tmpbpf) != 1) { if (ConfGetChildValue(if_root, "bpf-filter", &tmpbpf) != 1) {
SCLogDebug("could not get bpf or none specified"); SCLogDebug("could not get bpf or none specified");
} else { } else {
/* TODO free this */ aconf->bpf_filter = tmpbpf;
aconf->bpf_filter = SCStrdup(tmpbpf);
} }
} else { } else {
SCLogInfo("BPF filter set from command line or via old 'bpf-filter' option."); SCLogInfo("BPF filter set from command line or via old 'bpf-filter' option.");

Loading…
Cancel
Save