aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2012-05-25 01:32:26 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2012-05-25 01:32:26 +0000
commit6272bd15782e3f021915f636feeaebcb74285a92 (patch)
tree380c71430c9be0ecd6f1f96dc4731bbe4408b6b9 /dumpcap.c
parent814682d0d8835dc51360b33787f1bc73d783464d (diff)
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
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 5705ab122d..2db55e6f7c 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -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 {