From 14c53e0e8739b8235c6f24629667574baad7126b Mon Sep 17 00:00:00 2001 From: kn Date: Tue, 28 Jul 2020 11:16:33 +0000 Subject: Add size to free(9) calls Those are for the gateway sockaddrs which get allocated in rt_setgate() with the same ROUNDUP(sa_len) approach. mpi already added a sizes for a few rt_gateway sockaddrs in two commits, these are the last one in route.c leaving only ifafree() behind. OK mpi --- sys/net/route.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys') diff --git a/sys/net/route.c b/sys/net/route.c index 90ccb1ae477..312eac51c3b 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.394 2020/06/24 22:03:43 cheloha Exp $ */ +/* $OpenBSD: route.c,v 1.395 2020/07/28 11:16:32 kn Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -932,7 +932,8 @@ rtrequest(int req, struct rt_addrinfo *info, u_int8_t prio, ifafree(ifa); rtfree(rt->rt_parent); rt_putgwroute(rt); - free(rt->rt_gateway, M_RTABLE, 0); + free(rt->rt_gateway, M_RTABLE, + ROUNDUP(rt->rt_gateway->sa_len)); free(ndst, M_RTABLE, ndst->sa_len); pool_put(&rtentry_pool, rt); return (error); @@ -964,7 +965,8 @@ rtrequest(int req, struct rt_addrinfo *info, u_int8_t prio, ifafree(ifa); rtfree(rt->rt_parent); rt_putgwroute(rt); - free(rt->rt_gateway, M_RTABLE, 0); + free(rt->rt_gateway, M_RTABLE, + ROUNDUP(rt->rt_gateway->sa_len)); free(ndst, M_RTABLE, ndst->sa_len); pool_put(&rtentry_pool, rt); return (EEXIST); -- cgit v1.2.3