From fc52a1e73812daaef425727fcf5f59ed6b75b2f9 Mon Sep 17 00:00:00 2001 From: Pantelis Kolatsis Date: Mon, 24 Apr 2023 19:35:41 +0000 Subject: [PATCH] prefix_route: convert to memory logging helper, add missing logging --- src/modules/prefix_route/tree.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/prefix_route/tree.c b/src/modules/prefix_route/tree.c index a90144d63af..c5e55826539 100644 --- a/src/modules/prefix_route/tree.c +++ b/src/modules/prefix_route/tree.c @@ -72,7 +72,7 @@ struct tree_item *tree_item_alloc(void) root = (struct tree_item *)shm_malloc(sizeof(*root)); if (NULL == root) { - LM_CRIT("shared memory alloc failed\n"); + SHM_MEM_CRITICAL; return NULL; } @@ -241,8 +241,10 @@ static struct tree *tree_alloc(void) struct tree *tree; tree = (struct tree *)shm_malloc(sizeof(*tree)); - if (NULL == tree) + if (NULL == tree) { + SHM_MEM_CRITICAL; return NULL; + } tree->root = NULL; atomic_set(&tree->refcnt, 0); @@ -325,6 +327,7 @@ int tree_init(void) /* Pointer to global tree must be in shared memory */ shared_tree = (struct tree **)shm_malloc(sizeof(*shared_tree)); if (NULL == shared_tree) { + SHM_MEM_ERROR; lock_destroy(shared_tree_lock); lock_dealloc(shared_tree_lock); shared_tree_lock=0;