Module Name:    src
Committed By:   christos
Date:           Thu Jun 14 16:17:19 UTC 2018

Modified Files:
        src/usr.sbin/route6d: route6d.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/usr.sbin/route6d/route6d.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/route6d/route6d.c
diff -u src/usr.sbin/route6d/route6d.c:1.71 src/usr.sbin/route6d/route6d.c:1.72
--- src/usr.sbin/route6d/route6d.c:1.71	Wed May  9 03:30:21 2018
+++ src/usr.sbin/route6d/route6d.c	Thu Jun 14 12:17:18 2018
@@ -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 @@ init(void)
 		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 @@ init(void)
 		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;

Reply via email to