Skip to content

Commit

Permalink
msrp: convert to memory logging helper
Browse files Browse the repository at this point in the history
  • Loading branch information
pantelisk98 authored and henningw committed Mar 29, 2023
1 parent 6492a6f commit 7be6d78
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/modules/msrp/msrp_cmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int msrp_cmap_init(int msize)
_msrp_cmap_head = (msrp_cmap_t*)shm_malloc(sizeof(msrp_cmap_t));
if(_msrp_cmap_head==NULL)
{
LM_ERR("no more shm\n");
SHM_MEM_ERROR;
return -1;
}
memset(_msrp_cmap_head, 0, sizeof(msrp_cmap_t));
Expand All @@ -83,7 +83,7 @@ int msrp_cmap_init(int msize)
_msrp_cmap_head->mapsize*sizeof(msrp_centry_t) );
if(_msrp_cmap_head->cslots==NULL)
{
LM_ERR("no more shm.\n");
SHM_MEM_ERROR;
shm_free(_msrp_cmap_head);
_msrp_cmap_head = NULL;
return -1;
Expand Down Expand Up @@ -234,7 +234,7 @@ int msrp_cmap_save(msrp_frame_t *mf)
it = (msrp_citem_t*)shm_malloc(msize);
if(it==NULL)
{
LM_ERR("no more shm\n");
SHM_MEM_ERROR;
return -1;
}
memset(it, 0, msize);
Expand Down
6 changes: 3 additions & 3 deletions src/modules/msrp/msrp_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ int msrp_parse_headers(msrp_frame_t *mf)
hdr = (msrp_hdr_t*)pkg_malloc(sizeof(msrp_hdr_t));
if(hdr==NULL)
{
LM_ERR("no more pkg\n");
PKG_MEM_ERROR;
return -1;
}
memset(hdr, 0, sizeof(msrp_hdr_t));
Expand Down Expand Up @@ -636,7 +636,7 @@ int msrp_explode_str(str_array_t *arr, str *in, str *del)
larr = pkg_mallocxz(n * sizeof(str));
if(larr==NULL)
{
LM_ERR("no more pkg\n");
PKG_MEM_ERROR;
return -1;
}

Expand Down Expand Up @@ -712,7 +712,7 @@ int msrp_parse_hdr_uri_list(msrp_hdr_t *hdr)
arr = pkg_mallocxz(sizeof(str_array_t));
if(arr==NULL)
{
LM_ERR("no more pkg\n");
PKG_MEM_ERROR;
return -1;
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/msrp/msrp_vars.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ int tr_msrp_eval_msrpuri(struct sip_msg *msg, tr_param_t *tp, int subtype,
_tr_msrpuri.s = (char*)pkg_malloc((val->rs.len+1)*sizeof(char));
if(_tr_msrpuri.s==NULL)
{
LM_ERR("no more private memory\n");
PKG_MEM_ERROR;
memset(&_tr_msrpuri, 0, sizeof(str));
memset(&_tr_parsed_msrpuri, 0, sizeof(msrp_uri_t));
return -1;
Expand Down

0 comments on commit 7be6d78

Please sign in to comment.