Skip to content

Commit

Permalink
uid_avp_db: better error handling
Browse files Browse the repository at this point in the history
(cherry picked from commit 42d74f3)
  • Loading branch information
miconda committed Aug 30, 2017
1 parent ff8c184 commit a41f7a1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/modules/uid_avp_db/extra_attrs.c
Expand Up @@ -175,7 +175,8 @@ int declare_attr_group(modparam_t type, char* _param)
} while (p);

if ((!rt->id) || (!rt->flag_name)) {
ERR("at least attribute group ID and flags must ve given\n");
ERR("at least attribute group ID and flags must be given\n");
pkg_free(rt);
return -1;
}
/* insert new element into registered tables */
Expand Down Expand Up @@ -449,6 +450,12 @@ int init_extra_avp_locks()
int i;
registered_table_t *t = tables;

if(register_script_cb(avpdb_post_script_cb,
REQUEST_CB | ONREPLY_CB | POST_SCRIPT_CB, 0)<0) {
LM_ERR("failed to register script callbacks\n");
return -1;
}

/* zero all 'lock counters' */
memset(lock_counters, 0, sizeof(lock_counters));

Expand All @@ -468,8 +475,6 @@ int init_extra_avp_locks()
t = t->next;
}

register_script_cb(avpdb_post_script_cb, REQUEST_CB | ONREPLY_CB | POST_SCRIPT_CB, 0);

return 0;
}

Expand Down

0 comments on commit a41f7a1

Please sign in to comment.