MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / fixup_iter_param

Function fixup_iter_param

modules/statistics/statistics.c:547–577  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

545}
546
547static int fixup_iter_param(void **param)
548{
549 struct list_head *ele;
550 struct stat_iter *iter;
551
552 list_for_each(ele, &script_iters) {
553 iter = list_entry(ele, struct stat_iter, list);
554
555 if (str_match((str *)*param, &iter->name)) {
556 *param = iter;
557 return 0;
558 }
559 }
560
561 iter = pkg_malloc(sizeof *iter);
562 if (!iter) {
563 LM_ERR("oom!\n");
564 return E_OUT_OF_MEM;
565 }
566 memset(iter, 0, sizeof *iter);
567
568 if (pkg_str_dup(&iter->name, (str*)*param) < 0) {
569 LM_ERR("oom!\n");
570 return E_OUT_OF_MEM;
571 }
572
573 list_add(&iter->list, &script_iters);
574
575 *param = iter;
576 return 0;
577}
578
579static int fixup_check_stat_group(void **param)
580{

Callers

nothing calls this directly

Calls 4

str_matchFunction · 0.85
pkg_str_dupFunction · 0.85
list_addFunction · 0.85
list_entryClass · 0.50

Tested by

no test coverage detected