Module: kamailio
Branch: master
Commit: 7e5cc3aa21a243ef19ec092fec10043b1178cae7
URL:
https://github.com/kamailio/kamailio/commit/7e5cc3aa21a243ef19ec092fec10043…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2020-07-29T10:32:05+02:00
pua_dialoginfo: convert to PKG/SHM memory logging helper functions
---
Modified: src/modules/pua_dialoginfo/dialog_publish.c
Modified: src/modules/pua_dialoginfo/pua_dialoginfo.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7e5cc3aa21a243ef19ec092fec10043…
Patch:
https://github.com/kamailio/kamailio/commit/7e5cc3aa21a243ef19ec092fec10043…
---
diff --git a/src/modules/pua_dialoginfo/dialog_publish.c
b/src/modules/pua_dialoginfo/dialog_publish.c
index 1abe8cb152..5c901a9845 100644
--- a/src/modules/pua_dialoginfo/dialog_publish.c
+++ b/src/modules/pua_dialoginfo/dialog_publish.c
@@ -240,7 +240,7 @@ str* build_dialoginfo(char *state, str *entity, str *peer, str
*callid,
body = (str*)pkg_malloc(sizeof(str));
if(body == NULL)
{
- LM_ERR("while allocating memory\n");
+ PKG_MEM_ERROR;
goto error;
}
memset(body, 0, sizeof(str));
@@ -327,7 +327,7 @@ void dialog_publish(char *state, str* ruri, str *entity, str *peer,
str *callid,
publ= (publ_info_t*)pkg_malloc(size);
if(publ== NULL)
{
- LM_ERR("no more share memory\n");
+ PKG_MEM_ERROR;
goto error;
}
memset(publ, 0, size);
diff --git a/src/modules/pua_dialoginfo/pua_dialoginfo.c
b/src/modules/pua_dialoginfo/pua_dialoginfo.c
index f3932493aa..eb37c61156 100644
--- a/src/modules/pua_dialoginfo/pua_dialoginfo.c
+++ b/src/modules/pua_dialoginfo/pua_dialoginfo.c
@@ -448,7 +448,7 @@ struct str_list* get_str_list(unsigned short avp_flags, int_str
avp_name) {
}
if (list_current==0) {
- LM_ERR("no more shm mem (%d)\n",len);
+ SHM_MEM_ERROR;
return 0;
}
@@ -483,7 +483,7 @@ struct dlginfo_cell* get_dialog_data(struct dlg_cell *dlg, int type)
dlginfo = (struct dlginfo_cell*)shm_malloc( len );
if (dlginfo==0) {
- LM_ERR("no more shm mem (%d)\n",len);
+ SHM_MEM_ERROR;
return NULL;
}
memset( dlginfo, 0, len);
@@ -531,7 +531,7 @@ struct dlginfo_cell* get_dialog_data(struct dlg_cell *dlg, int type)
dlginfo->pubruris_caller =
(struct str_list*)shm_malloc( sizeof(struct str_list) );
if (dlginfo->pubruris_caller==0) {
- LM_ERR("no more shm mem (%d)\n", (int) sizeof(struct str_list));
+ SHM_MEM_ERROR;
free_dlginfo_cell(dlginfo);
return NULL;
}
@@ -546,7 +546,7 @@ struct dlginfo_cell* get_dialog_data(struct dlg_cell *dlg, int type)
dlginfo->pubruris_callee =
(struct str_list*)shm_malloc( sizeof(struct str_list) );
if (dlginfo->pubruris_callee==0) {
- LM_ERR("no more shm mem (%d)\n", (int) sizeof(struct str_list));
+ SHM_MEM_ERROR;
free_dlginfo_cell(dlginfo);
return NULL;
}
@@ -567,7 +567,7 @@ struct dlginfo_cell* get_dialog_data(struct dlg_cell *dlg, int type)
dlginfo->pubruris_caller =
(struct str_list*)shm_malloc( sizeof(struct str_list) );
if (dlginfo->pubruris_caller==0) {
- LM_ERR("no more shm mem (%d)\n", (int) sizeof(struct str_list));
+ SHM_MEM_ERROR;
free_dlginfo_cell(dlginfo);
return NULL;
}
@@ -577,7 +577,7 @@ struct dlginfo_cell* get_dialog_data(struct dlg_cell *dlg, int type)
dlginfo->pubruris_callee =
(struct str_list*)shm_malloc( sizeof(struct str_list) );
if (dlginfo->pubruris_callee==0) {
- LM_ERR("no more shm mem (%d)\n", (int) sizeof(struct str_list));
+ SHM_MEM_ERROR;
free_dlginfo_cell(dlginfo);
return NULL;
}