summaryrefslogtreecommitdiff
path: root/lib/libc/net/freeaddrinfo.c
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-01-27 08:23:47 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-01-27 08:23:47 +0000
commit4d61544ad05fb8e9a896298f94773aaaf3b4ba15 (patch)
tree63a46b952e652086734c28bfcfefc02eb9bfbb0d /lib/libc/net/freeaddrinfo.c
parent98f40bbc84e70cdf4b25f5ee817c6eebe3d46a3d (diff)
avoid memory leakage on freeaddrinfo().
(this bug was introduced since we mix KAME getaddrinfo and NRL freeaddrinfo).
Diffstat (limited to 'lib/libc/net/freeaddrinfo.c')
-rw-r--r--lib/libc/net/freeaddrinfo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc/net/freeaddrinfo.c b/lib/libc/net/freeaddrinfo.c
index cdabe14d095..40534f44224 100644
--- a/lib/libc/net/freeaddrinfo.c
+++ b/lib/libc/net/freeaddrinfo.c
@@ -42,6 +42,8 @@ freeaddrinfo(ai)
while (ai) {
p = ai;
ai = ai->ai_next;
+ if (p->ai_canonname)
+ free(p->ai_canonname);
free((void *)p);
}
}