In cap_pipe_open_live(), be sure to call ws_close(fd) before returning due to a couple of error condtions. Fixes Coverity CID 702395 Resource leak.

svn path=/trunk/; revision=42844
This commit is contained in:
Chris Maynard 2012-05-25 01:32:26 +00:00
parent 814682d0d8
commit 6272bd1578
1 changed files with 2 additions and 0 deletions

View File

@ -1868,6 +1868,7 @@ cap_pipe_open_live(char *pipename,
"The capture session coud not be initiated "
"due to error on socket connect: Path name too long");
pcap_opts->cap_pipe_err = PIPERR;
ws_close(fd);
return;
}
b = connect(fd, (struct sockaddr *)&sa, sizeof sa);
@ -1876,6 +1877,7 @@ cap_pipe_open_live(char *pipename,
"The capture session coud not be initiated "
"due to error on socket connect: %s", g_strerror(errno));
pcap_opts->cap_pipe_err = PIPERR;
ws_close(fd);
return;
}
} else {