Module: kamailio
Branch: master
Commit: a3fe9388540ee3ba0331b642e1c26170ca572e60
URL:
https://github.com/kamailio/kamailio/commit/a3fe9388540ee3ba0331b642e1c2617…
Author: Pantelis Kolatsis <pk(a)gilawa.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2023-04-24T19:30:54Z
path: convert to memory logging helper
---
Modified: src/modules/path/path.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a3fe9388540ee3ba0331b642e1c2617…
Patch:
https://github.com/kamailio/kamailio/commit/a3fe9388540ee3ba0331b642e1c2617…
---
diff --git a/src/modules/path/path.c b/src/modules/path/path.c
index c90aa939004..f1d8a624646 100644
--- a/src/modules/path/path.c
+++ b/src/modules/path/path.c
@@ -68,8 +68,10 @@ static char *path_strzdup(char *src, int len)
if(len<0) {
len = strlen(src);
}
- if (!(res = (char *) pkg_malloc(len + 1)))
+ if (!(res = (char *) pkg_malloc(len + 1))) {
+ PKG_MEM_ERROR;
return NULL;
+ }
strncpy(res, src, len);
res[len] = 0;
@@ -112,7 +114,7 @@ static int prepend_path(sip_msg_t* _m, str *user, path_param_t param,
cp = suffix = pkg_malloc(suffix_len);
if (!suffix) {
- LM_ERR("no pkg memory left for suffix\n");
+ PKG_MEM_ERROR_FMT("for suffix\n");
goto out1;
}
@@ -165,7 +167,7 @@ static int prepend_path(sip_msg_t* _m, str *user, path_param_t param,
prefix_len = PATH_PREFIX_LEN + (user ? user->len : 0) + 2;
prefix = pkg_malloc(prefix_len);
if (!prefix) {
- LM_ERR("no pkg memory left for prefix\n");
+ PKG_MEM_ERROR_FMT("for prefix\n");
goto out2;
}
if (user && user->len)