an error return was missing a pcap_close() call

svn path=/trunk/; revision=17404
This commit is contained in:
Ulf Lamping 2006-02-25 00:02:26 +00:00
parent e6fb194094
commit f5661a9970
1 changed files with 3 additions and 1 deletions

View File

@ -366,8 +366,10 @@ get_pcap_linktype_list(const char *devname, char *err_buf)
deflt = get_pcap_linktype(pch, devname);
#ifdef HAVE_PCAP_LIST_DATALINKS
nlt = pcap_list_datalinks(pch, &linktypes);
if (nlt == 0 || linktypes == NULL)
if (nlt == 0 || linktypes == NULL) {
pcap_close(pch);
return NULL;
}
for (i = 0; i < nlt; i++) {
data_link_info = create_data_link_info(linktypes[i]);