summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-11-23 19:46:56 -0800
committerGuy Harris <guy@alum.mit.edu>2019-11-28 17:30:47 -0800
commit89bb57d210a126d60047ff0f235868ceafc76e9b (patch)
tree14ae49c71968f34fa6ec1d1deeebab7b6b7e2b45
parent1d5504867726e4611becbf16945d6345ada97660 (diff)
downloadlibpcap-89bb57d210a126d60047ff0f235868ceafc76e9b.tar.gz
Remind people that if pcap_activate() fails, the pcap_t is still around.
[skip ci] (cherry picked from commit b262e73dfdda6599b3b08750fcd6ff2a6a5a16c0)
-rw-r--r--pcap.3pcap.in4
-rw-r--r--pcap_activate.3pcap7
2 files changed, 11 insertions, 0 deletions
diff --git a/pcap.3pcap.in b/pcap.3pcap.in
index 80101403..b2db565e 100644
--- a/pcap.3pcap.in
+++ b/pcap.3pcap.in
@@ -41,6 +41,10 @@ other interface on which the capture should be done, call
.BR pcap_create (),
set the appropriate options on the handle, and then activate it with
.BR pcap_activate ().
+If
+.BR pcap_activate ()
+fails, the handle should be closed with
+.BR pcap_close() .
.PP
To obtain a list of devices that can be opened for a live capture, call
.BR pcap_findalldevs ();
diff --git a/pcap_activate.3pcap b/pcap_activate.3pcap
index 162a9293..b9279ce1 100644
--- a/pcap_activate.3pcap
+++ b/pcap_activate.3pcap
@@ -118,5 +118,12 @@ codes as errors.
.B pcap_statustostr(3PCAP)
can be called, with a warning or error code as an argument, to fetch a
message describing the warning or error code.
+.LP
+If
+.B pcap_activate()
+fails, the
+.I pcap_t *
+is not closed and freed; it should be closed using
+.BR pcap_close() .
.SH SEE ALSO
pcap(3PCAP)