Module: kamailio
Branch: master
Commit: 78e658cd70d23f3665f08f436d8b9a9fa99769f9
URL:
https://github.com/kamailio/kamailio/commit/78e658cd70d23f3665f08f436d8b9a9…
Author: Pantelis Kolatsis <pk(a)gilawa.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2023-04-25T11:29:37Z
kex: convert to memory logging helper, add missing mem error logging
---
Modified: src/modules/kex/km_core.c
Modified: src/modules/kex/pkg_stats.c
---
Diff:
https://github.com/kamailio/kamailio/commit/78e658cd70d23f3665f08f436d8b9a9…
Patch:
https://github.com/kamailio/kamailio/commit/78e658cd70d23f3665f08f436d8b9a9…
---
diff --git a/src/modules/kex/km_core.c b/src/modules/kex/km_core.c
index f0d97f1af97..583377379b5 100644
--- a/src/modules/kex/km_core.c
+++ b/src/modules/kex/km_core.c
@@ -76,7 +76,7 @@ int pv_printf_fixup(void** param, int param_no)
spec = (pv_spec_t*)pkg_malloc(sizeof(pv_spec_t));
if(spec==NULL)
{
- LM_ERR("out of pkg\n");
+ PKG_MEM_ERROR;
return -1;
}
memset(spec, 0, sizeof(pv_spec_t));
diff --git a/src/modules/kex/pkg_stats.c b/src/modules/kex/pkg_stats.c
index 15ce1dcf2c0..35565cbcd9e 100644
--- a/src/modules/kex/pkg_stats.c
+++ b/src/modules/kex/pkg_stats.c
@@ -78,7 +78,10 @@ int pkg_proc_stats_init(void)
_pkg_proc_stats_list = (pkg_proc_stats_t*)shm_malloc(
_pkg_proc_stats_no*sizeof(pkg_proc_stats_t));
if(_pkg_proc_stats_list==NULL)
+ {
+ SHM_MEM_ERROR;
return -1;
+ }
memset(_pkg_proc_stats_list, 0,
_pkg_proc_stats_no*sizeof(pkg_proc_stats_t));
return 0;