From 385b3ea3956aefc2868cdd838fc0a90f1d8a7857 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Tue, 30 Nov 2021 18:16:49 +0100 Subject: For safer memory allocations, resources are bound to loops. Also all loops have their basic resource pool for allocations which are auto-freed when the loop is stopping. --- proto/radv/radv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'proto/radv/radv.c') diff --git a/proto/radv/radv.c b/proto/radv/radv.c index d572c1b7..b0f15514 100644 --- a/proto/radv/radv.c +++ b/proto/radv/radv.c @@ -284,7 +284,7 @@ radv_iface_new(struct radv_proto *p, struct iface *iface, struct radv_iface_conf RADV_TRACE(D_EVENTS, "Adding interface %s", iface->name); - pool *pool = rp_new(p->p.pool, iface->name); + pool *pool = rp_new(p->p.pool, p->p.loop, iface->name); ifa = mb_allocz(pool, sizeof(struct radv_iface)); ifa->pool = pool; ifa->ra = p; @@ -317,7 +317,7 @@ radv_iface_remove(struct radv_iface *ifa) rem_node(NODE ifa); - rfree(ifa->pool); + rp_free(ifa->pool, p->p.pool); } static void -- cgit v1.2.3