Module: kamailio Branch: master Commit: 32c917f6a9a1bf4f5b95d3bdcbc5f3efdd209948 URL: https://github.com/kamailio/kamailio/commit/32c917f6a9a1bf4f5b95d3bdcbc5f3ef...
Author: Henning Westerholt hw@skalatan.de Committer: Henning Westerholt hw@skalatan.de Date: 2020-02-13T23:08:35+01:00
topoh: convert to memory logging helper
---
Modified: src/modules/topoh/th_mask.c Modified: src/modules/topoh/th_msg.c Modified: src/modules/topoh/topoh_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/32c917f6a9a1bf4f5b95d3bdcbc5f3ef... Patch: https://github.com/kamailio/kamailio/commit/32c917f6a9a1bf4f5b95d3bdcbc5f3ef...
---
diff --git a/src/modules/topoh/th_mask.c b/src/modules/topoh/th_mask.c index cc2ae7e5a9..122d0935a5 100644 --- a/src/modules/topoh/th_mask.c +++ b/src/modules/topoh/th_mask.c @@ -98,7 +98,7 @@ char* th_mask_encode(char *in, int ilen, str *prefix, int *olen) out = (char*)pkg_malloc((*olen+1)*sizeof(char)); if(out==NULL) { - LM_ERR("no more pkg\n"); + PKG_MEM_ERROR; *olen = 0; return NULL; } @@ -151,7 +151,7 @@ char* th_mask_decode(char *in, int ilen, str *prefix, int extra, int *olen)
if(out==NULL) { - LM_ERR("no more pkg\n"); + PKG_MEM_ERROR; *olen = 0; return NULL; } diff --git a/src/modules/topoh/th_msg.c b/src/modules/topoh/th_msg.c index 6849520540..990128c01e 100644 --- a/src/modules/topoh/th_msg.c +++ b/src/modules/topoh/th_msg.c @@ -294,7 +294,7 @@ int th_mask_contact(sip_msg_t *msg) p = (char*)pkg_malloc(out.len+3); if(p==NULL) { - LM_ERR("failed to get more pkg\n"); + PKG_MEM_ERROR; pkg_free(out.s); return -1; } @@ -441,7 +441,7 @@ int th_unmask_via(sip_msg_t *msg, str *cookie) via2=pkg_malloc(sizeof(struct via_body)); if (via2==0) { - LM_ERR("out of memory\n"); + PKG_MEM_ERROR; pkg_free(out.s); return -1;
@@ -983,7 +983,7 @@ int th_add_via_cookie(sip_msg_t *msg, struct via_body *via) out.s = (char*)pkg_malloc(out.len+1); if(out.s==0) { - LM_ERR("no pkg memory\n"); + PKG_MEM_ERROR; return -1; } out.s[0] = ';'; @@ -1009,7 +1009,7 @@ int th_add_hdr_cookie(sip_msg_t *msg) h.s = (char*)pkg_malloc(h.len+1); if(h.s == 0) { - LM_ERR("no more pkg\n"); + PKG_MEM_ERROR; return -1; } anchor = anchor_lump(msg, msg->unparsed - msg->buf, 0, 0); diff --git a/src/modules/topoh/topoh_mod.c b/src/modules/topoh/topoh_mod.c index 0eb5345598..fb5d045910 100644 --- a/src/modules/topoh/topoh_mod.c +++ b/src/modules/topoh/topoh_mod.c @@ -186,7 +186,7 @@ static int mod_init(void) th_via_prefix.s = (char*)pkg_malloc(th_via_prefix.len+1); if(th_via_prefix.s==NULL) { - LM_ERR("via prefix parameter is invalid\n"); + PKG_MEM_ERROR_FMT("via prefix parameter\n"); goto error; } /* 'sip:' + ip + ';' + param + '=' + prefix (+ '\0') */ @@ -195,7 +195,7 @@ static int mod_init(void) th_uri_prefix.s = (char*)pkg_malloc(th_uri_prefix.len+1); if(th_uri_prefix.s==NULL) { - LM_ERR("uri prefix parameter is invalid\n"); + PKG_MEM_ERROR_FMT("uri prefix parameter\n"); goto error; } /* build via prefix */