summaryrefslogtreecommitdiffstats
path: root/main/libc0.9.32/uclibc-resolv-fix-memory-leak.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/libc0.9.32/uclibc-resolv-fix-memory-leak.patch')
-rw-r--r--main/libc0.9.32/uclibc-resolv-fix-memory-leak.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/main/libc0.9.32/uclibc-resolv-fix-memory-leak.patch b/main/libc0.9.32/uclibc-resolv-fix-memory-leak.patch
new file mode 100644
index 000000000..8738ba774
--- /dev/null
+++ b/main/libc0.9.32/uclibc-resolv-fix-memory-leak.patch
@@ -0,0 +1,33 @@
+From bb8d500a75a3050fe3198773ce7b07f669fe8f13 Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Fri, 14 Oct 2011 15:47:42 +0000
+Subject: resolv: fix memory leak
+
+Timothy Holdener writes:
+small memory leak in __dns_lookup() when the A record
+in the DNS answer is preceded by one or more CNAME records.
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
+index 38254bd..e415d30 100644
+--- a/libc/inet/resolv.c
++++ b/libc/inet/resolv.c
+@@ -1507,6 +1507,7 @@ int attribute_hidden __dns_lookup(const char *name,
+ DPRINTF("Decoding answer at pos %d\n", pos);
+
+ first_answer = 1;
++ a->dotted = NULL;
+ for (j = 0; j < h.ancount; j++) {
+ i = __decode_answer(packet, pos, packet_len, &ma);
+ if (i < 0) {
+@@ -1523,6 +1524,7 @@ int attribute_hidden __dns_lookup(const char *name,
+ ma.buf = a->buf;
+ ma.buflen = a->buflen;
+ ma.add_count = a->add_count;
++ free(a->dotted);
+ memcpy(a, &ma, sizeof(ma));
+ if (a->atype != T_SIG && (NULL == a->buf || (type != T_A && type != T_AAAA)))
+ break;
+--
+cgit v0.9.0.1-2-gef13