From: Anatoly Burakov Date: Fri, 12 Jan 2018 17:23:16 +0000 (+0000) Subject: member: fix memory leak on error X-Git-Tag: spdx-start~226 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5988076ac3393a0ca46e8dca0baa4d0c4f672b44;p=dpdk.git member: fix memory leak on error rte_member may have allocated a tailq entry or setum before failure, so free them. Fixes: 857ed6c68cf2 ("member: implement main API") Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov Acked-by: Yipeng Wang --- diff --git a/lib/librte_member/rte_member.c b/lib/librte_member/rte_member.c index ab76d7754b..e147dd1f16 100644 --- a/lib/librte_member/rte_member.c +++ b/lib/librte_member/rte_member.c @@ -162,8 +162,9 @@ rte_member_create(const struct rte_member_parameters *params) return setsum; error_unlock_exit: + rte_free(te); + rte_free(setsum); rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); - rte_member_free(setsum); return NULL; }