Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] Re: Issue 80 in ndt: Code Review - Fix for OpenSocket() causing a double free() of previously free()'d memory

Subject: NDT-DEV email list created

List archive

[ndt-dev] Re: Issue 80 in ndt: Code Review - Fix for OpenSocket() causing a double free() of previously free()'d memory


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] Re: Issue 80 in ndt: Code Review - Fix for OpenSocket() causing a double free() of previously free()'d memory
  • Date: Fri, 19 Apr 2013 17:05:38 +0000
  • Authentication-results: sfpop-ironport03.merit.edu; dkim=neutral (message not signed) header.i=none


Comment #3 on issue 80 by : Code Review - Fix for OpenSocket() causing a double free() of previously free()'d memory
http://code.google.com/p/ndt/issues/detail?id=80

I think a clearer solution would probably look something like:

break out most of the existing OpenSocket function into an internal one that takes the family and whether to instaniate v4-to-v6 as options.

Then have OpenSocket do:

return = NULL;

if (require v4) {
return = __OpenSocket(addr, AF_INET, 0);
}
else if (require v6) {
return = __OpenSocket(addr, AF_INET6, 0);
}
else {
return = __OpenSocket(addr, AF_INET6, 1);
if (!return) {
return = __OpenSocket(addr, AF_INET, 0);
}
}

This disentangles the odd logic of v4/v6 choice from the actual instantiation of socket, and would allow some comments explaining the choice in the OpenSocket function.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings



Archive powered by MHonArc 2.6.16.

Top of Page