Skip to content

Commit

Permalink
prefix_route: convert to memory logging helper, add missing logging
Browse files Browse the repository at this point in the history
  • Loading branch information
pantelisk98 authored and henningw committed Apr 24, 2023
1 parent 56a843b commit fc52a1e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/modules/prefix_route/tree.c
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fc52a1e

Please sign in to comment.