diff options
author | kn <kn@cvs.openbsd.org> | 2020-07-28 11:16:33 +0000 |
---|---|---|
committer | kn <kn@cvs.openbsd.org> | 2020-07-28 11:16:33 +0000 |
commit | 14c53e0e8739b8235c6f24629667574baad7126b (patch) | |
tree | c3fa71c86275102bfdcbbc3c6b12707fef73717d /sys | |
parent | 9459bcaf8411f213b57681fe86a3291ad60b03e2 (diff) |
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
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/route.c | 8 |
1 files changed, 5 insertions, 3 deletions
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); |