From 601fb4389dd87cdccc9ab393bea2b502d08dc96a Mon Sep 17 00:00:00 2001 From: Adrian Knoth Date: Thu, 17 Jan 2008 12:29:12 +0000 Subject: [PATCH] Cosmetics for r17150. Closes trac:1201 This commit was SVN r17151. The following SVN revision numbers were found above: r17150 --> open-mpi/ompi@4b50f0212684cab4945b1490bff98d57f0c05493 The following Trac tickets were found above: Ticket 1201 --> https://svn.open-mpi.org/trac/ompi/ticket/1201 --- opal/util/if.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/opal/util/if.c b/opal/util/if.c index 0f40a4d826..d0ce8c90fe 100644 --- a/opal/util/if.c +++ b/opal/util/if.c @@ -919,7 +919,7 @@ int opal_ifaddrtoname(const char* if_addr, char* if_name, int length) int rc; #if OPAL_WANT_IPV6 int error; - struct addrinfo hints, *res, *r; + struct addrinfo hints, *res = NULL, *r; #else #ifndef __WINDOWS__ in_addr_t inaddr; @@ -938,7 +938,6 @@ int opal_ifaddrtoname(const char* if_addr, char* if_name, int length) memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; - res = NULL; error = getaddrinfo(if_addr, NULL, &hints, &res); if (error) { @@ -972,8 +971,10 @@ int opal_ifaddrtoname(const char* if_addr, char* if_name, int length) } } } - } - freeaddrinfo (res); + } + if (NULL != res) { + freeaddrinfo (res); + } #else inaddr = inet_addr(if_addr);