summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/client
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2018-10-02 16:33:56 -0400
committerFlorin Coras <florin.coras@gmail.com>2018-10-02 21:36:12 +0000
commit819d5fdb39526386ee8fe4a8729f960e84443cbd (patch)
treef81e79c45024a20e04c817d5a0f44cd26b3d6ee8 /src/vpp-api/client
parentbf49590c07162be44b21d0e0440e7fb96b2746d5 (diff)
VPP-1440: clean up coverity warnings
Change-Id: Ic6823fb617ecae547a5f0e28b1e037848e40f682 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vpp-api/client')
-rw-r--r--src/vpp-api/client/stat_client.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vpp-api/client/stat_client.c b/src/vpp-api/client/stat_client.c
index a539fbaa4e6..d415972de68 100644
--- a/src/vpp-api/client/stat_client.c
+++ b/src/vpp-api/client/stat_client.c
@@ -102,12 +102,14 @@ stat_segment_connect (char *socket_name)
if (connect (sock, (struct sockaddr *) &un, sizeof (struct sockaddr_un)) <
0)
{
+ close (sock);
perror ("connect");
return -1;
}
if ((mfd = recv_fd (sock)) < 0)
{
+ close (sock);
fprintf (stderr, "Receiving file descriptor failed\n");
return -1;
}
@@ -119,12 +121,14 @@ stat_segment_connect (char *socket_name)
if (fstat (mfd, &st) == -1)
{
+ close (sock);
perror ("mmap");
return -1;
}
if ((memaddr =
mmap (NULL, st.st_size, PROT_READ, MAP_SHARED, mfd, 0)) == MAP_FAILED)
{
+ close (sock);
perror ("mmap");
return -1;
}