aboutsummaryrefslogtreecommitdiffstats
path: root/pcap-snoop.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2009-09-21 10:45:09 -0700
committerGuy Harris <guy@alum.mit.edu>2009-09-21 10:45:09 -0700
commit71dac45765e9bbb9a2851ee3b1eaecfac6e7a8fd (patch)
tree7a5038d9ece2ca34716e8d1db0c141231f58a699 /pcap-snoop.c
parent2fbb5a5e315355746f0c863bf4a9757057478561 (diff)
If an activate routine fails, it needs to clean up the pcap_t, close
anything it's opened, etc.. In addition, the op pointers need to be restored to the un-activated state; do that in pcap_activate() if the call to the activate op fails. Also, in the common cleanup code, set the fd's to -1.
Diffstat (limited to 'pcap-snoop.c')
-rw-r--r--pcap-snoop.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pcap-snoop.c b/pcap-snoop.c
index c8259a4..330e01d 100644
--- a/pcap-snoop.c
+++ b/pcap-snoop.c
@@ -389,6 +389,7 @@ pcap_activate_snoop(pcap_t *p)
return (0);
bad:
+ pcap_cleanup_live_common(p);
return (PCAP_ERROR);
}