After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 765355 - Two more leaks of struct addrinfo in xmlNanoFTPConnect() for error condition in IPv6 support
Two more leaks of struct addrinfo in xmlNanoFTPConnect() for error condition ...
Status: RESOLVED NOTABUG
Product: libxml2
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-21 01:58 UTC by David Kilzer
Modified: 2017-11-13 14:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Kilzer 2016-04-21 01:58:03 UTC
There are two more leaks in xmlNanoFTPConnect() after Bug 732352 was fixed:

<https://git.gnome.org/browse/libxml2/tree/nanoftp.c#n880>

	if (proxy) {
	    if (getaddrinfo (proxy, NULL, &hints, &result) != 0) {
		__xmlIOErr(XML_FROM_FTP, 0, "getaddrinfo failed");
		// Leak of result here if set.
		return (-1);
	    }
	}
	else
	    if (getaddrinfo (ctxt->hostname, NULL, &hints, &result) != 0) {
		__xmlIOErr(XML_FROM_FTP, 0, "getaddrinfo failed");
		// Leak of result here if set.
		return (-1);
	    }
Comment 1 Nick Wellnhofer 2017-11-13 14:55:57 UTC
If the result is non-zero, `getaddrinfo` failed and no `struct addrinfo` is
returned in `result`.