Module: kamailio
Branch: master
Commit: bfe9fedfbf705ea6d37c5fa116f35bce6d9dfa67
URL:
https://github.com/kamailio/kamailio/commit/bfe9fedfbf705ea6d37c5fa116f35bc…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2018-12-28T15:57:27+01:00
app_perl: use mem error macros
---
Modified: src/modules/app_perl/app_perl_mod.c
Modified: src/modules/app_perl/kamailioxs.xs
---
Diff:
https://github.com/kamailio/kamailio/commit/bfe9fedfbf705ea6d37c5fa116f35bc…
Patch:
https://github.com/kamailio/kamailio/commit/bfe9fedfbf705ea6d37c5fa116f35bc…
---
diff --git a/src/modules/app_perl/app_perl_mod.c b/src/modules/app_perl/app_perl_mod.c
index d8789f919d..3852fa118c 100644
--- a/src/modules/app_perl/app_perl_mod.c
+++ b/src/modules/app_perl/app_perl_mod.c
@@ -217,7 +217,7 @@ PerlInterpreter *parser_init(void) {
LM_INFO("setting lib path: '%s'\n", entry);
argv[argc] = pkg_malloc(strlen(entry)+20);
if (!argv[argc]) {
- LM_ERR("not enough pkg mem\n");
+ PKG_MEM_ERROR;
return NULL;
}
sprintf(argv[argc], "-I%s", entry);
@@ -329,7 +329,7 @@ static int mod_init(void) {
_ap_reset_cycles = shm_malloc(sizeof(int));
if(_ap_reset_cycles == NULL) {
- LM_ERR("no more shared memory\n");
+ SHM_MEM_ERROR;
return -1;
}
*_ap_reset_cycles = _ap_reset_cycles_init;
diff --git a/src/modules/app_perl/kamailioxs.xs b/src/modules/app_perl/kamailioxs.xs
index faaa5b1fae..8feec95b2c 100644
--- a/src/modules/app_perl/kamailioxs.xs
+++ b/src/modules/app_perl/kamailioxs.xs
@@ -236,7 +236,7 @@ int moduleFunc(struct sip_msg *m, char *func,
if (param1) {
argv[0] = (char *)pkg_malloc(strlen(param1)+1);
if (!argv[0]) {
- LM_ERR("not enough pkg mem\n");
+ PKG_MEM_ERROR;
return -1;
}
strcpy(argv[0], param1);
@@ -248,7 +248,7 @@ int moduleFunc(struct sip_msg *m, char *func,
if (param2) {
argv[1] = (char *)pkg_malloc(strlen(param2)+1);
if (!argv[1]) {
- LM_ERR("not enough pkg mem\n");
+ PKG_MEM_ERROR;
if (argv[0]) pkg_free(argv[0]);
return -1;
}