Skip to content

Commit

Permalink
sms: convert to memory logging helper, fix some related wrong log mes…
Browse files Browse the repository at this point in the history
…sages
  • Loading branch information
pantelisk98 authored and henningw committed Apr 21, 2023
1 parent 569714e commit 2a9402d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/modules/sms/sms.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/modules/sms/sms_funcs.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/sms/sms_report.c
Expand Up @@ -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) );
Expand Down

0 comments on commit 2a9402d

Please sign in to comment.