From 71dac45765e9bbb9a2851ee3b1eaecfac6e7a8fd Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 21 Sep 2009 10:45:09 -0700 Subject: 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. --- pcap-snoop.c | 1 + 1 file changed, 1 insertion(+) (limited to 'pcap-snoop.c') 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); } -- cgit v1.2.3