Commit 11ac9e74 authored by Philip Carns's avatar Philip Carns
Browse files

fix duplicate address registration memory leak

parent 2abbe991
......@@ -3094,7 +3094,11 @@ static int tcp_do_work_recv(bmi_method_addr_p map, int* stall_flag)
if(new_header.src_addr_hash == 0)
{
/* client connection; there is no identifier in the header */
/* register this address with the method control layer */
/* register this address with the method control layer if it has
* not been registered already
*/
if(!tcp_addr_data->bmi_addr)
{
tcp_addr_data->bmi_addr = bmi_method_addr_reg_callback(map);
if (ret < 0)
{
......@@ -3103,6 +3107,7 @@ static int tcp_do_work_recv(bmi_method_addr_p map, int* stall_flag)
return (ret);
}
}
}
else
{
/* server connection; search to see if we can find an address
......@@ -3129,7 +3134,11 @@ static int tcp_do_work_recv(bmi_method_addr_p map, int* stall_flag)
/* add entry to hash table so we can find it later */
qhash_add(addr_hash_table, &tcp_addr_data->addr_hash,
&tcp_addr_data->hash_link);
/* register this address with the method control layer */
/* register this address with the method control layer if it has
* not been registered already
*/
if(!tcp_addr_data->bmi_addr)
{
tcp_addr_data->bmi_addr = bmi_method_addr_reg_callback(map);
if (ret < 0)
{
......@@ -3140,6 +3149,7 @@ static int tcp_do_work_recv(bmi_method_addr_p map, int* stall_flag)
}
}
}
}
gossip_ldebug(GOSSIP_BMI_DEBUG_TCP, "Received new message; mode: %d.\n",
(int) new_header.mode);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment