[libxml2] Leak of struct addrinfo in xmlNanoFTPConnect()
- From: Daniel Veillard <veillard src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Leak of struct addrinfo in xmlNanoFTPConnect()
- Date: Mon, 6 Oct 2014 11:30:00 +0000 (UTC)
commit d72cb06de95a100058315bc0c3359d7c46583113
Author: Gaurav Gupta <g gupta samsung com>
Date: Mon Oct 6 19:28:29 2014 +0800
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.
nanoftp.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/nanoftp.c b/nanoftp.c
index f467e5a..2135ab9 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]