aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vpp-api/client/stat_client.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vpp-api/client/stat_client.c b/src/vpp-api/client/stat_client.c
index 25a37f76da8..761c73f0fb7 100644
--- a/src/vpp-api/client/stat_client.c
+++ b/src/vpp-api/client/stat_client.c
@@ -141,16 +141,19 @@ stat_segment_connect_r (const char *socket_name, stat_client_main_t * sm)
if (fstat (mfd, &st) == -1)
{
+ close (mfd);
perror ("mmap fstat failed");
return -4;
}
if ((memaddr =
mmap (NULL, st.st_size, PROT_READ, MAP_SHARED, mfd, 0)) == MAP_FAILED)
{
+ close (mfd);
perror ("mmap map failed");
return -5;
}
+ close (mfd);
sm->memory_size = st.st_size;
sm->shared_header = memaddr;
sm->directory_vector =