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 732352 - Leak of struct addrinfo in xmlNanoFTPConnect() for error condition in IPv6 support
Leak of struct addrinfo in xmlNanoFTPConnect() for error condition in IPv6 su...
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other Mac OS
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2014-06-27 16:07 UTC by David Kilzer
Modified: 2016-04-21 02:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix the reported leaking resource in nanoftp.c (356 bytes, patch)
2014-09-26 04:31 UTC, Gaurav
none Details | Review

Description David Kilzer 2014-06-27 16:07:20 UTC
The early return here doesn't call freeaddrinfo(result), thus leaking memory:

	if (tmp->ai_addrlen > sizeof(ctxt->ftpAddr)) {
	    __xmlIOErr(XML_FROM_FTP, 0, "gethostbyname address mismatch");
	    return (-1);
	}

<https://git.gnome.org/browse/libxml2/tree/nanoftp.c#n910>
Comment 1 Gaurav 2014-09-26 04:30:09 UTC
Correct, it is a bug.
Attaching the patch.

Please commit.
Comment 2 Gaurav 2014-09-26 04:31:16 UTC
Created attachment 287121 [details] [review]
Fix the reported leaking resource in nanoftp.c
Comment 3 Daniel Veillard 2014-10-06 11:30:33 UTC
Ack similar to the way it's handled a few lines above,

  thanks to both, patch pushed on git !

Daniel
Comment 4 David Kilzer 2016-04-21 01:32:52 UTC
Fixed in d72cb06de95a100058315bc0c3359d7c46583113:

<https://git.gnome.org/browse/libxml2/commit/?id=d72cb06de95a100058315bc0c3359d7c46583113>

Thanks!