Module: kamailio
Branch: master
Commit: b2b4eda387ec21ebac2db7258cabda2b9c9ed81b
URL:
https://github.com/kamailio/kamailio/commit/b2b4eda387ec21ebac2db7258cabda2…
Author: Pantelis Kolatsis <pk(a)gilawa.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2023-04-25T11:52:31Z
statistics: convert to memory logging helper
---
Modified: src/modules/statistics/statistics.c
Modified: src/modules/statistics/stats_funcs.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b2b4eda387ec21ebac2db7258cabda2…
Patch:
https://github.com/kamailio/kamailio/commit/b2b4eda387ec21ebac2db7258cabda2…
---
diff --git a/src/modules/statistics/statistics.c b/src/modules/statistics/statistics.c
index 3ffa58865b2..a8a1de484ad 100644
--- a/src/modules/statistics/statistics.c
+++ b/src/modules/statistics/statistics.c
@@ -125,7 +125,7 @@ static int fixup_stat(void** param, int param_no)
/* var name - string or pv */
sopv = (struct stat_or_pv *)pkg_malloc(sizeof(struct stat_or_pv));
if (sopv==NULL) {
- LM_ERR("no more pkg mem\n");
+ PKG_MEM_ERROR;
return E_OUT_OF_MEM;
}
memset( sopv, 0 , sizeof(struct stat_or_pv) );
@@ -151,7 +151,7 @@ static int fixup_stat(void** param, int param_no)
} else if (param_no==2) {
lopv = (struct long_or_pv *) pkg_malloc(sizeof(struct long_or_pv));
if (lopv == NULL) {
- LM_ERR("no more pkg mem\n");
+ PKG_MEM_ERROR;
return E_OUT_OF_MEM;
}
memset(lopv, 0, sizeof(struct long_or_pv));
diff --git a/src/modules/statistics/stats_funcs.c b/src/modules/statistics/stats_funcs.c
index c75beafae4b..bc3e5cbd56f 100644
--- a/src/modules/statistics/stats_funcs.c
+++ b/src/modules/statistics/stats_funcs.c
@@ -76,7 +76,7 @@ int reg_statistic( char* name)
se = (stat_elem*)pkg_malloc( sizeof(stat_elem) );
if (se==0) {
- LM_ERR("no more pkg mem\n");
+ PKG_MEM_ERROR;
goto error;
}