Module: kamailio Branch: master Commit: 5c7de00bc0826cf739577010ba7b4882e83819cc URL: https://github.com/kamailio/kamailio/commit/5c7de00bc0826cf739577010ba7b4882...
Author: Victor Seva linuxmaniac@torreviejawireless.org Committer: Victor Seva linuxmaniac@torreviejawireless.org Date: 2023-08-09T13:21:05+02:00
regex: convert to memory error logging helper
---
Modified: src/modules/regex/regex_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/5c7de00bc0826cf739577010ba7b4882... Patch: https://github.com/kamailio/kamailio/commit/5c7de00bc0826cf739577010ba7b4882...
---
diff --git a/src/modules/regex/regex_mod.c b/src/modules/regex/regex_mod.c index e9943dc57e0..2860e11a413 100644 --- a/src/modules/regex/regex_mod.c +++ b/src/modules/regex/regex_mod.c @@ -198,13 +198,13 @@ static int mod_init(void)
/* Pointer to pcres */ if((pcres_addr = shm_malloc(sizeof(pcre **))) == 0) { - LM_ERR("no memory for pcres_addr\n"); + SHM_MEM_ERROR; goto err; }
/* Integer containing the number of pcres */ if((num_pcres = shm_malloc(sizeof(int))) == 0) { - LM_ERR("no memory for num_pcres\n"); + SHM_MEM_ERROR; goto err; }
@@ -425,14 +425,14 @@ static int load_pcres(int action) shm_free(pcres); } if((pcres = shm_malloc(sizeof(pcre *) * num_pcres_tmp)) == 0) { - LM_ERR("no more memory for pcres\n"); + SHM_MEM_ERROR; goto err; } memset(pcres, 0, sizeof(pcre *) * num_pcres_tmp); for(i = 0; i < num_pcres_tmp; i++) { pcre_rc = pcre_fullinfo(pcres_tmp[i], NULL, PCRE_INFO_SIZE, &pcre_size); if((pcres[i] = shm_malloc(pcre_size)) == 0) { - LM_ERR("no more memory for pcres[%i]\n", i); + SHM_MEM_ERROR; goto err; } memcpy(pcres[i], pcres_tmp[i], pcre_size);