summaryrefslogtreecommitdiff
path: root/nanohttp.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2003-07-10 14:04:33 +0000
committerDaniel Veillard <veillard@src.gnome.org>2003-07-10 14:04:33 +0000
commit3dc93a42432cbf6e40d4ac3a4e61152d86a9f7dd (patch)
tree94759075f2517f8126dbc628e66ea7d5bda03526 /nanohttp.c
parentdf101d832da9db9efd59ab194b18ccc5a7274bd1 (diff)
downloadlibxml2-3dc93a42432cbf6e40d4ac3a4e61152d86a9f7dd.tar.gz
cleanup patches from Peter Breitenlohner Daniel
* nanoftp.c nanohttp.c: cleanup patches from Peter Breitenlohner Daniel
Diffstat (limited to 'nanohttp.c')
-rw-r--r--nanohttp.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/nanohttp.c b/nanohttp.c
index 0034a171..b6457205 100644
--- a/nanohttp.c
+++ b/nanohttp.c
@@ -996,14 +996,13 @@ xmlNanoHTTPConnectHost(const char *host, int port)
}
for (res = result; res; res = res->ai_next) {
- if (res) {
+ if (res->ai_family == AF_INET || res->ai_family == AF_INET6) {
if (res->ai_family == AF_INET6) {
memcpy (&sockin6, res->ai_addr, res->ai_addrlen);
sockin6.sin6_port = htons (port);
addr = (struct sockaddr *)&sockin6;
}
-
- if (res->ai_family == AF_INET) {
+ else {
memcpy (&sockin, res->ai_addr, res->ai_addrlen);
sockin.sin_port = htons (port);
addr = (struct sockaddr *)&sockin;
@@ -1015,11 +1014,10 @@ xmlNanoHTTPConnectHost(const char *host, int port)
return (s);
}
}
- else {
- freeaddrinfo (result);
- return (-1);
- }
}
+ if (result)
+ freeaddrinfo (result);
+ return (-1);
} else
#endif
#endif