Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/route6d PR/53365: Thomas Barabosch: memory leak in ...



details:   https://anonhg.NetBSD.org/src/rev/5af888b18fd4
branches:  trunk
changeset: 319871:5af888b18fd4
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jun 14 16:17:18 2018 +0000

description:
PR/53365: Thomas Barabosch: memory leak in route6d
XXX: pullup 7, 8

diffstat:

 usr.sbin/route6d/route6d.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 0cec529c8309 -r 5af888b18fd4 usr.sbin/route6d/route6d.c
--- a/usr.sbin/route6d/route6d.c        Thu Jun 14 14:48:59 2018 +0000
+++ b/usr.sbin/route6d/route6d.c        Thu Jun 14 16:17:18 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: route6d.c,v 1.71 2018/05/09 07:30:21 maxv Exp $        */
+/*     $NetBSD: route6d.c,v 1.72 2018/06/14 16:17:18 christos Exp $    */
 /*     $KAME: route6d.c,v 1.94 2002/10/26 20:08:55 itojun Exp $        */
 
 /*
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #ifndef        lint
-__RCSID("$NetBSD: route6d.c,v 1.71 2018/05/09 07:30:21 maxv Exp $");
+__RCSID("$NetBSD: route6d.c,v 1.72 2018/06/14 16:17:18 christos Exp $");
 #endif
 
 #include <stdbool.h>
@@ -594,6 +594,7 @@
                fatal("rip IPV6_RECVPKTINFO");
        }
 
+       freeaddrinfo(res);
        memset(&hints, 0, sizeof(hints));
        hints.ai_family = PF_INET6;
        hints.ai_socktype = SOCK_DGRAM;
@@ -605,6 +606,7 @@
                fatal("%s resolved to multiple address", RIP6_DEST);
        }
        memcpy(&ripsin, res->ai_addr, res->ai_addrlen);
+       freeaddrinfo(res);
 
        set[0].fd = ripsock;
        set[0].events = POLLIN;



Home | Main Index | Thread Index | Old Index