PR/53365: Thomas Barabosch: memory leak in route6d

XXX: pullup 7, 8
This commit is contained in:
christos 2018-06-14 16:17:18 +00:00
parent edb6f1effc
commit c85e5e1ae4

View File

@ -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;