summaryrefslogtreecommitdiff
path: root/pcap-dos.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-04-15 16:36:59 -0700
committerGuy Harris <guy@alum.mit.edu>2016-04-15 16:36:59 -0700
commit4418d041840c295df2ad6ac97459a3e460a8f3d4 (patch)
tree130a802a1e48c007649835162f32bdb121494c1c /pcap-dos.c
parentdca2f470ba8ff755361129c9956899bec46357e2 (diff)
downloadlibpcap-4418d041840c295df2ad6ac97459a3e460a8f3d4.tar.gz
Don't check for NULL in cleanup routines, and don't pass NULL to them.
pcap_close() won't pass a null pointer - it'll crash long before that when handed a null pointer, as the platforms on which we run map out page 0. Remove the null pointer checks, and, in cases where the cleanup routines are called internally, make sure we don't pass them a null pointer.
Diffstat (limited to 'pcap-dos.c')
-rw-r--r--pcap-dos.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pcap-dos.c b/pcap-dos.c
index bf4777da..c9a6a7c7 100644
--- a/pcap-dos.c
+++ b/pcap-dos.c
@@ -451,7 +451,7 @@ static void pcap_cleanup_dos (pcap_t *p)
{
struct pcap_dos *pd;
- if (p && !exc_occured)
+ if (!exc_occured)
{
pd = p->priv;
if (pcap_stats(p,NULL) < 0)
@@ -783,7 +783,7 @@ static void exc_handler (int sig)
fprintf (stderr, "Catching signal %d.\n", sig);
}
exc_occured = 1;
- pcap_cleanup_dos (NULL);
+ close_driver();
}
#endif /* __DJGPP__ */