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

fix duplicate address registration memory leak

parent 2abbe991
...@@ -3094,13 +3094,18 @@ static int tcp_do_work_recv(bmi_method_addr_p map, int* stall_flag) ...@@ -3094,13 +3094,18 @@ static int tcp_do_work_recv(bmi_method_addr_p map, int* stall_flag)
if(new_header.src_addr_hash == 0) if(new_header.src_addr_hash == 0)
{ {
/* client connection; there is no identifier in the header */ /* 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
tcp_addr_data->bmi_addr = bmi_method_addr_reg_callback(map); * not been registered already
if (ret < 0) */
if(!tcp_addr_data->bmi_addr)
{ {
tcp_shutdown_addr(map); tcp_addr_data->bmi_addr = bmi_method_addr_reg_callback(map);
dealloc_tcp_method_addr(map); if (ret < 0)
return (ret); {
tcp_shutdown_addr(map);
dealloc_tcp_method_addr(map);
return (ret);
}
} }
} }
else else
...@@ -3129,13 +3134,18 @@ static int tcp_do_work_recv(bmi_method_addr_p map, int* stall_flag) ...@@ -3129,13 +3134,18 @@ 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 */ /* add entry to hash table so we can find it later */
qhash_add(addr_hash_table, &tcp_addr_data->addr_hash, qhash_add(addr_hash_table, &tcp_addr_data->addr_hash,
&tcp_addr_data->hash_link); &tcp_addr_data->hash_link);
/* register this address with the method control layer */ /* register this address with the method control layer if it has
tcp_addr_data->bmi_addr = bmi_method_addr_reg_callback(map); * not been registered already
if (ret < 0) */
if(!tcp_addr_data->bmi_addr)
{ {
tcp_shutdown_addr(map); tcp_addr_data->bmi_addr = bmi_method_addr_reg_callback(map);
dealloc_tcp_method_addr(map); if (ret < 0)
return (ret); {
tcp_shutdown_addr(map);
dealloc_tcp_method_addr(map);
return (ret);
}
} }
} }
} }
......
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