Skip to content

Commit

Permalink
app_perl: use mem error macros
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxmaniac committed Dec 28, 2018
1 parent 529a341 commit bfe9fed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/modules/app_perl/app_perl_mod.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/app_perl/kamailioxs.xs
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down

0 comments on commit bfe9fed

Please sign in to comment.