From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id E58EB2C1A for ; Tue, 15 Mar 2016 13:26:03 +0100 (CET) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id F263E24ACF for ; Tue, 15 Mar 2016 13:25:20 +0100 (CET) From: Olivier Matz To: dev@dpdk.org Date: Tue, 15 Mar 2016 13:25:51 +0100 Message-Id: <1458044751-365-1-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH] lpm: fix memory leak X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 12:26:04 -0000 Internal lpm structures are not properly freed. Seen with the lpm6 autotest. Signed-off-by: Olivier Matz --- lib/librte_lpm/rte_lpm.c | 3 +++ lib/librte_lpm/rte_lpm6.c | 1 + 2 files changed, 4 insertions(+) diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c index dd62f9b..d28e954 100644 --- a/lib/librte_lpm/rte_lpm.c +++ b/lib/librte_lpm/rte_lpm.c @@ -318,6 +318,7 @@ rte_lpm_create_v1604(const char *name, int socket_id, if (lpm->tbl8 == NULL) { RTE_LOG(ERR, LPM, "LPM memory allocation failed\n"); + rte_free(lpm->rules_tbl); rte_free(lpm); rte_free(te); goto exit; @@ -406,6 +407,8 @@ rte_lpm_free_v1604(struct rte_lpm *lpm) rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_free(lpm->tbl8); + rte_free(lpm->rules_tbl); rte_free(lpm); rte_free(te); } diff --git a/lib/librte_lpm/rte_lpm6.c b/lib/librte_lpm/rte_lpm6.c index 4e9f2d0..faf7684 100644 --- a/lib/librte_lpm/rte_lpm6.c +++ b/lib/librte_lpm/rte_lpm6.c @@ -288,6 +288,7 @@ rte_lpm6_free(struct rte_lpm6 *lpm) rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_free(lpm->rules_tbl); rte_free(lpm); rte_free(te); } -- 2.1.4