Skip to content

Commit

Permalink
prov/tcp: Fix memory leak of dest_addr handling cm req
Browse files Browse the repository at this point in the history
In tcpx_cm_recv_req, we duplicate the passive endpoint's
fi_info structure.  The dest_addr is then replaced without
the original dup'ed address being freed.  Free it first.

Fixes asan memory leak report.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
  • Loading branch information
shefty authored and aingerson committed Jul 20, 2021
1 parent a756b29 commit 885e643
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions prov/tcp/src/tcpx_conn_mgr.c
Expand Up @@ -337,6 +337,7 @@ static void tcpx_cm_recv_req(struct util_wait *wait,
goto err2;

len = cm_entry->info->dest_addrlen = handle->pep->info->src_addrlen;
free(cm_entry->info->dest_addr);
cm_entry->info->dest_addr = malloc(len);
if (!cm_entry->info->dest_addr)
goto err3;
Expand Down

0 comments on commit 885e643

Please sign in to comment.