From 9f2bb5ce8a275d84146a42d13c981b2ea5e39222 Mon Sep 17 00:00:00 2001 From: Remy Horton Date: Mon, 20 Jun 2016 16:23:07 +0100 Subject: [PATCH] examples/l2fwd-keepalive: fix memory leak Fixes memory leaks detected by Coverity. These are due to ephemeral memory allocations not being freed when errors occur. Coverity issue: 127349 Fixes: e2aae1c1ced9 ("ethdev: remove name from extended statistic fetch") Signed-off-by: Remy Horton --- examples/l2fwd-keepalive/shm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/l2fwd-keepalive/shm.c b/examples/l2fwd-keepalive/shm.c index 66fc433bb7..177aa5b8e6 100644 --- a/examples/l2fwd-keepalive/shm.c +++ b/examples/l2fwd-keepalive/shm.c @@ -80,6 +80,8 @@ struct rte_keepalive_shm *rte_keepalive_shm_create(void) RTE_LOG(INFO, EAL, "Failed to setup SHM semaphore (%s)\n", strerror(errno)); + munmap(ka_shm, + sizeof(struct rte_keepalive_shm)); return NULL; } -- 2.20.1