Skip to content

Commit

Permalink
pua_dialoginfo: convert to PKG/SHM memory logging helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxmaniac committed Jul 29, 2020
1 parent 06b7e41 commit 7e5cc3a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/modules/pua_dialoginfo/dialog_publish.c
Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand Down
12 changes: 6 additions & 6 deletions src/modules/pua_dialoginfo/pua_dialoginfo.c
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 7e5cc3a

Please sign in to comment.