diff options
author | Henri Doreau <hdoreau@sourceforge.net> | 2011-03-13 07:02:25 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-03-13 07:03:15 -0700 |
commit | 472b30c57608f1102ad2d303b7304b44f858e9e5 (patch) | |
tree | 7d1b9b0868f6b6cad11be17c5a4cb4be44d50dcf | |
parent | a32aefb6bcc58610e3f738cda69f1d941c668421 (diff) | |
download | libpcap-472b30c57608f1102ad2d303b7304b44f858e9e5.tar.gz |
Close handles on error.
Reviewed-By: Guy Harris <guy@alum.mit.edu>
-rw-r--r-- | pcap-linux.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pcap-linux.c b/pcap-linux.c index 5d291e95..c7542417 100644 --- a/pcap-linux.c +++ b/pcap-linux.c @@ -1880,6 +1880,7 @@ scan_sys_class_net(pcap_if_t **devlistp, char *errbuf) if (fd < 0) { (void)snprintf(errbuf, PCAP_ERRBUF_SIZE, "socket: %s", pcap_strerror(errno)); + (void)closedir(sys_class_net_d); return (-1); } @@ -2013,6 +2014,7 @@ scan_proc_net_dev(pcap_if_t **devlistp, char *errbuf) if (fd < 0) { (void)snprintf(errbuf, PCAP_ERRBUF_SIZE, "socket: %s", pcap_strerror(errno)); + (void)fclose(proc_net_f); return (-1); } |