Module: kamailio
Branch: master
Commit: 7be6d78f5f9ee7aacef1a73321d4a384a7722077
URL:
https://github.com/kamailio/kamailio/commit/7be6d78f5f9ee7aacef1a73321d4a38…
Author: Pantelis Kolatsis <pk(a)gilawa.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2023-03-29T09:52:04Z
msrp: convert to memory logging helper
---
Modified: src/modules/msrp/msrp_cmap.c
Modified: src/modules/msrp/msrp_parser.c
Modified: src/modules/msrp/msrp_vars.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7be6d78f5f9ee7aacef1a73321d4a38…
Patch:
https://github.com/kamailio/kamailio/commit/7be6d78f5f9ee7aacef1a73321d4a38…
---
diff --git a/src/modules/msrp/msrp_cmap.c b/src/modules/msrp/msrp_cmap.c
index 2fc6a8d740b..42100f4f905 100644
--- a/src/modules/msrp/msrp_cmap.c
+++ b/src/modules/msrp/msrp_cmap.c
@@ -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));
@@ -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;
@@ -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);
diff --git a/src/modules/msrp/msrp_parser.c b/src/modules/msrp/msrp_parser.c
index c701d6a6cad..0b36288b67c 100644
--- a/src/modules/msrp/msrp_parser.c
+++ b/src/modules/msrp/msrp_parser.c
@@ -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));
@@ -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;
}
@@ -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;
}
diff --git a/src/modules/msrp/msrp_vars.c b/src/modules/msrp/msrp_vars.c
index 8384ff09107..b9d14b03b7a 100644
--- a/src/modules/msrp/msrp_vars.c
+++ b/src/modules/msrp/msrp_vars.c
@@ -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;