From 8b5f7cc99ecf9f4a5e076591730c358445f303a4 Mon Sep 17 00:00:00 2001 From: risso Date: Thu, 24 Oct 2002 08:09:42 +0000 Subject: There was a bug in pcap_open_offline: in case of error, the returned pointer was freed but the open file was not closed. Thus, a handle on the opened file was kept and could not be released as the returned pointer was null. --- savefile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/savefile.c b/savefile.c index 7175ab4..1caba97 100644 --- a/savefile.c +++ b/savefile.c @@ -30,7 +30,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.68 2002-10-18 08:46:15 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.69 2002-10-24 08:09:42 risso Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -483,6 +483,8 @@ pcap_open_offline(const char *fname, char *errbuf) return (p); bad: + if(fp) + fclose(fp); free(p); return (NULL); } -- cgit v1.2.3