From e784f2e7c13d8731763315b9eacf980a43e6c691 Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Fri, 25 May 2012 14:45:06 +0000 Subject: [PATCH] -freeing addrinfo --- src/testing/testing_new.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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, while (pos < 32) { if (0 == ((xor_image >> pos) & 1U)) - break; + continue; open_port = (index * 32) + pos; GNUNET_asprintf (&open_port_str, "%u", open_port); hint.ai_family = AF_UNSPEC; /* IPv4 and IPv6 */ @@ -244,8 +244,10 @@ reserve_port (struct GNUNET_TESTING_System *system, GNUNET_free (open_port_str); if (GNUNET_OK == GNUNET_NETWORK_socket_bind (socket, ret->ai_addr, ret->ai_addrlen)) { + freeaddrinfo (ret); return open_port; } + freeaddrinfo (ret); /* This port is in use by some other application */ port_buckets[index] |= (1U << pos); pos++; -- 2.25.1