Module: kamailio
Branch: master
Commit: 2a9402d4159824f857a5c8b8fcb5f96f42094e5a
URL:
https://github.com/kamailio/kamailio/commit/2a9402d4159824f857a5c8b8fcb5f96…
Author: Pantelis Kolatsis <pk(a)gilawa.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2023-04-21T17:59:50Z
sms: convert to memory logging helper, fix some related wrong log messages
---
Modified: src/modules/sms/sms.c
Modified: src/modules/sms/sms_funcs.c
Modified: src/modules/sms/sms_report.c
---
Diff:
https://github.com/kamailio/kamailio/commit/2a9402d4159824f857a5c8b8fcb5f96…
Patch:
https://github.com/kamailio/kamailio/commit/2a9402d4159824f857a5c8b8fcb5f96…
---
diff --git a/src/modules/sms/sms.c b/src/modules/sms/sms.c
index 123ba127fa8..a6f0a2d3afa 100644
--- a/src/modules/sms/sms.c
+++ b/src/modules/sms/sms.c
@@ -540,7 +540,7 @@ int global_init(void)
domain.len = si->name.len + i*(si->port_no_str.len+1);
domain.s = (char*)pkg_malloc(domain.len);
if (!domain.s) {
- LM_ERR("no free pkg memory!\n");
+ PKG_MEM_ERROR;
goto error;
}
p = domain.s;
@@ -584,7 +584,7 @@ int global_init(void)
/* alloc in shm for queued_msgs */
queued_msgs = (int*)shm_malloc(sizeof(int));
if (!queued_msgs) {
- LM_ERR("cannot get shm memory!\n");
+ SHM_MEM_ERROR;
goto error;
}
*queued_msgs = 0;
diff --git a/src/modules/sms/sms_funcs.c b/src/modules/sms/sms_funcs.c
index 6c44dc87da1..34e980bf163 100644
--- a/src/modules/sms/sms_funcs.c
+++ b/src/modules/sms/sms_funcs.c
@@ -226,7 +226,7 @@ int push_on_network(struct sip_msg *msg, int net)
/* allocs a new sms_msg structure in shared memory */
sms_messg = (struct sms_msg*)shm_malloc(len);
if (!sms_messg) {
- LM_ERR("failed to get shm memory!\n");
+ SHM_MEM_ERROR;
goto error;
}
p = (char*)sms_messg + sizeof(struct sms_msg);
@@ -341,7 +341,7 @@ int send_sip_msg_request(str *to, str *from_user, str *body)
if (hdrs.s) pkg_free(hdrs.s);
return foo;
error:
- LM_ERR("no free pkg memory!\n");
+ PKG_MEM_ERROR;
if (from.s) pkg_free(from.s);
if (hdrs.s) pkg_free(hdrs.s);
return -1;
@@ -371,7 +371,7 @@ static inline int send_error(struct sms_msg *sms_messg, char *msg1_s,
int msg1_l
pkg_free( body.s );
return foo;
error:
- LM_ERR("no free pkg memory!\n");
+ PKG_MEM_ERROR;
return -1;
}
diff --git a/src/modules/sms/sms_report.c b/src/modules/sms/sms_report.c
index 4dcfa44b1d5..9b7983ea54c 100644
--- a/src/modules/sms/sms_report.c
+++ b/src/modules/sms/sms_report.c
@@ -126,7 +126,7 @@ int init_report_queue(void)
report_queue = (struct report_cell*)
shm_malloc(NR_CELLS*sizeof(struct report_cell));
if (!report_queue) {
- LM_ERR("no more free pkg_mem!\n");
+ SHM_MEM_ERROR;
return -1;
}
memset( report_queue , 0 , NR_CELLS*sizeof(struct report_cell) );