summaryrefslogtreecommitdiff
path: root/lib/librte_member/rte_member.c
diff options
context:
space:
mode:
authorAnatoly Burakov <anatoly.burakov@intel.com>2018-01-12 17:23:16 +0000
committerThomas Monjalon <thomas@monjalon.net>2018-01-19 00:43:56 +0100
commit5988076ac3393a0ca46e8dca0baa4d0c4f672b44 (patch)
tree88c48d2b288761fe731aa167d714e23ca6b856fd /lib/librte_member/rte_member.c
parent9ac7f8e57290df0e1d3da6c33010feb5ccb66dfb (diff)
downloaddpdk-5988076ac3393a0ca46e8dca0baa4d0c4f672b44.zip
dpdk-5988076ac3393a0ca46e8dca0baa4d0c4f672b44.tar.gz
dpdk-5988076ac3393a0ca46e8dca0baa4d0c4f672b44.tar.xz
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 <anatoly.burakov@intel.com> Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
Diffstat (limited to 'lib/librte_member/rte_member.c')
-rw-r--r--lib/librte_member/rte_member.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/librte_member/rte_member.c b/lib/librte_member/rte_member.c
index ab76d77..e147dd1 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;
}