diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-05-25 14:45:06 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-05-25 14:45:06 +0000 |
commit | e784f2e7c13d8731763315b9eacf980a43e6c691 (patch) | |
tree | 75d3c532df2eae641b1e999df177cca8f0c6a33d | |
parent | 021305c67cf4295ec4562040b4fbccda227d7412 (diff) | |
download | gnunet-e784f2e7c13d8731763315b9eacf980a43e6c691.tar.gz gnunet-e784f2e7c13d8731763315b9eacf980a43e6c691.zip |
-freeing addrinfo
-rw-r--r-- | src/testing/testing_new.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/testing/testing_new.c b/src/testing/testing_new.c index e6c4cb56f..a836a4905 100644 --- a/src/testing/testing_new.c +++ b/src/testing/testing_new.c | |||
@@ -228,7 +228,7 @@ reserve_port (struct GNUNET_TESTING_System *system, | |||
228 | while (pos < 32) | 228 | while (pos < 32) |
229 | { | 229 | { |
230 | if (0 == ((xor_image >> pos) & 1U)) | 230 | if (0 == ((xor_image >> pos) & 1U)) |
231 | break; | 231 | continue; |
232 | open_port = (index * 32) + pos; | 232 | open_port = (index * 32) + pos; |
233 | GNUNET_asprintf (&open_port_str, "%u", open_port); | 233 | GNUNET_asprintf (&open_port_str, "%u", open_port); |
234 | hint.ai_family = AF_UNSPEC; /* IPv4 and IPv6 */ | 234 | hint.ai_family = AF_UNSPEC; /* IPv4 and IPv6 */ |
@@ -244,8 +244,10 @@ reserve_port (struct GNUNET_TESTING_System *system, | |||
244 | GNUNET_free (open_port_str); | 244 | GNUNET_free (open_port_str); |
245 | if (GNUNET_OK == GNUNET_NETWORK_socket_bind (socket, ret->ai_addr, ret->ai_addrlen)) | 245 | if (GNUNET_OK == GNUNET_NETWORK_socket_bind (socket, ret->ai_addr, ret->ai_addrlen)) |
246 | { | 246 | { |
247 | freeaddrinfo (ret); | ||
247 | return open_port; | 248 | return open_port; |
248 | } | 249 | } |
250 | freeaddrinfo (ret); | ||
249 | /* This port is in use by some other application */ | 251 | /* This port is in use by some other application */ |
250 | port_buckets[index] |= (1U << pos); | 252 | port_buckets[index] |= (1U << pos); |
251 | pos++; | 253 | pos++; |