diff options
author | Maria Matejka <mq@ucw.cz> | 2021-11-30 18:16:49 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2021-11-30 21:38:25 +0100 |
commit | 385b3ea3956aefc2868cdd838fc0a90f1d8a7857 (patch) | |
tree | d954b853724153e4a2411d57be5f29e5b9236251 /conf | |
parent | ab0994a10c26bd76b4154a675267d96d19dfb509 (diff) |
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.
Diffstat (limited to 'conf')
-rw-r--r-- | conf/conf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/conf/conf.c b/conf/conf.c index 58abcde1..c6837a07 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -89,7 +89,7 @@ int undo_available; /* Undo was not requested from last reconfiguration */ struct config * config_alloc(const char *name) { - pool *p = rp_new(&root_pool, "Config"); + pool *p = rp_new(&root_pool, &main_birdloop, "Config"); linpool *l = lp_new_default(p); struct config *c = lp_allocz(l, sizeof(struct config)); @@ -196,7 +196,7 @@ void config_free(struct config *c) { if (c) - rfree(c->pool); + rp_free(c->pool, &root_pool); } void |