Module: kamailio
Branch: master
Commit: 41c814b7cfbed2d89099840c29580d99b2a3cc47
URL: 
https://github.com/kamailio/kamailio/commit/41c814b7cfbed2d89099840c29580d99b2a3cc47

Author: Pantelis Kolatsis <[email protected]>
Committer: Henning Westerholt <[email protected]>
Date: 2023-03-29T11:32:56Z

imc: convert to memory logging helper

---

Modified: src/modules/imc/imc_cmd.c
Modified: src/modules/imc/imc_mng.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/41c814b7cfbed2d89099840c29580d99b2a3cc47.diff
Patch: 
https://github.com/kamailio/kamailio/commit/41c814b7cfbed2d89099840c29580d99b2a3cc47.patch

---

diff --git a/src/modules/imc/imc_cmd.c b/src/modules/imc/imc_cmd.c
index ea76e79816..4e0925ac6b 100644
--- a/src/modules/imc/imc_cmd.c
+++ b/src/modules/imc/imc_cmd.c
@@ -172,7 +172,7 @@ static int build_uri(str *res, str value, struct sip_uri 
*template)
        }
 
        if ((res->s = (char*)pkg_malloc(len)) == NULL) {
-               LM_ERR("No memory left\n");
+               PKG_MEM_ERROR;
                return -1;
        }
        res->len = len;
@@ -716,7 +716,7 @@ int imc_handle_invite(struct sip_msg* msg, imc_cmd_t *cmd,
                LM_ERR("Truncated message '%.*s'\n", STR_FMT(&body));
 
        if ((cback_param = (del_member_t*)shm_malloc(sizeof(del_member_t))) == 
NULL) {
-               LM_ERR("No shared memory left\n");
+               SHM_MEM_ERROR;
                goto error;
        }
        memset(cback_param, 0, sizeof(del_member_t));
diff --git a/src/modules/imc/imc_mng.c b/src/modules/imc/imc_mng.c
index 73c2d68caf..89c32c80cb 100644
--- a/src/modules/imc/imc_mng.c
+++ b/src/modules/imc/imc_mng.c
@@ -56,7 +56,7 @@ int imc_htable_init(void)
        _imc_htable = 
(imc_hentry_p)shm_malloc(imc_hash_size*sizeof(imc_hentry_t));
        if(_imc_htable == NULL)
        {
-               LM_ERR("no more shm memory\n");
+               SHM_MEM_ERROR;
                return -1;
        }
        memset(_imc_htable, 0, imc_hash_size*sizeof(imc_hentry_t));
@@ -494,7 +494,7 @@ imc_room_p imc_add_room(str* name, str* domain, int flags)
        irp = (imc_room_p)shm_malloc(size);
        if(irp==NULL)
        {
-               LM_ERR("no more shm memory left\n");
+               SHM_MEM_ERROR;
                return NULL;
        }
        memset(irp, 0, size);
@@ -671,7 +671,7 @@ imc_member_p imc_add_member(imc_room_p room, str* user, 
str* domain, int flags)
        imp = (imc_member_p)shm_malloc(size);
        if(imp== NULL)
        {
-               LM_ERR("out of shm memory\n");
+               SHM_MEM_ERROR;
                return NULL;
        }
        memset(imp, 0, size);

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to [email protected]

Reply via email to