summaryrefslogtreecommitdiff
path: root/debian/patches/0049-Leak-of-struct-addrinfo-in-xmlNanoFTPConnect.patch
blob: 45a4f150b614d65887797380961a31a3f2a0b252 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From: Gaurav Gupta <g.gupta@samsung.com>
Date: Mon, 6 Oct 2014 19:28:29 +0800
Subject: 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 file changed, 2 insertions(+)

diff --git a/nanoftp.c b/nanoftp.c
index 077bfe2..010e0b1 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);
 	}