mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-13 13:17:36 +03:00
cleanup patches from Peter Breitenlohner Daniel
* nanoftp.c nanohttp.c: cleanup patches from Peter Breitenlohner Daniel
This commit is contained in:
parent
df101d832d
commit
3dc93a4243
@ -1,3 +1,7 @@
|
||||
Thu Jul 10 16:02:47 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* nanoftp.c nanohttp.c: cleanup patches from Peter Breitenlohner
|
||||
|
||||
Tue Jul 8 16:02:19 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* globals.c threads.c: fixes some problem when freeing unititialized
|
||||
|
@ -1044,7 +1044,12 @@ xmlNanoFTPConnect(void *ctx) {
|
||||
if (tmp->ai_family == AF_INET || tmp->ai_family == AF_INET6)
|
||||
break;
|
||||
|
||||
if (tmp) {
|
||||
if (!tmp) {
|
||||
if (result)
|
||||
freeaddrinfo (result);
|
||||
return (-1);
|
||||
}
|
||||
else {
|
||||
if (tmp->ai_family == AF_INET6) {
|
||||
memcpy (&ctxt->ftpAddr, tmp->ai_addr, tmp->ai_addrlen);
|
||||
((struct sockaddr_in6 *) &ctxt->ftpAddr)->sin6_port = htons (port);
|
||||
|
12
nanohttp.c
12
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
|
||||
|
Loading…
Reference in New Issue
Block a user