From 819d5fdb39526386ee8fe4a8729f960e84443cbd Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Tue, 2 Oct 2018 16:33:56 -0400 Subject: VPP-1440: clean up coverity warnings Change-Id: Ic6823fb617ecae547a5f0e28b1e037848e40f682 Signed-off-by: Dave Barach --- src/vpp-api/client/stat_client.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/vpp-api/client') 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; } -- cgit 1.2.3-korg