getaddrinfo returns linked list. Fix iteration accordingly.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
src/util/virsocketaddr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virsocketaddr.c b/src/util/virsocketaddr.c
index 4cad329..4c9f124 100644
--- a/src/util/virsocketaddr.c
+++ b/src/util/virsocketaddr.c
@@ -271,7 +271,7 @@ int virSocketAddrResolveService(const char *service)
port = ntohs(in.sin6_port);
goto cleanup;
}
- tmp++;
+ tmp = tmp->ai_next;
}
virReportError(VIR_ERR_SYSTEM_ERROR,
--
1.8.3.1