summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaurav Gupta <g.gupta@samsung.com>2014-10-06 19:28:29 +0800
committerDaniel Veillard <veillard@redhat.com>2014-10-06 19:28:29 +0800
commitd72cb06de95a100058315bc0c3359d7c46583113 (patch)
tree6b62b1658147eb110236324f552e81129c8fed58
parent292a9f293decfcd1de8870d93866bf450f3f555f (diff)
downloadlibxml2-d72cb06de95a100058315bc0c3359d7c46583113.tar.gz
Leak of struct addrinfo in xmlNanoFTPConnect()
For https://bugzilla.gnome.org/show_bug.cgi?id=732352 in case of error condition in IPv6 support, the early return here doesn't call freeaddrinfo(result), thus leaking memory.
-rw-r--r--nanoftp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/nanoftp.c b/nanoftp.c
index f467e5a0..2135ab9b 100644
--- a/nanoftp.c
+++ b/nanoftp.c
@@ -908,6 +908,8 @@ xmlNanoFTPConnect(void *ctx) {
return (-1);
}
if (tmp->ai_addrlen > sizeof(ctxt->ftpAddr)) {
+ if (result)
+ freeaddrinfo (result);
__xmlIOErr(XML_FROM_FTP, 0, "gethostbyname address mismatch");
return (-1);
}