Module: kamailio
Branch: master
Commit: 7378aa0f7dcbde237bb5701f40b8a2d008d78b45
URL:
https://github.com/kamailio/kamailio/commit/7378aa0f7dcbde237bb5701f40b8a2d…
Author: Pantelis Kolatsis <pk(a)gilawa.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2023-03-22T12:15:35Z
cfgutils: convert to memory error logging helper, add missing free in error case
---
Modified: src/modules/cfgutils/cfgutils.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7378aa0f7dcbde237bb5701f40b8a2d…
Patch:
https://github.com/kamailio/kamailio/commit/7378aa0f7dcbde237bb5701f40b8a2d…
---
diff --git a/src/modules/cfgutils/cfgutils.c b/src/modules/cfgutils/cfgutils.c
index 9a77b40aed8..bf4b0680bbc 100644
--- a/src/modules/cfgutils/cfgutils.c
+++ b/src/modules/cfgutils/cfgutils.c
@@ -884,14 +884,15 @@ static int mod_init(void)
probability=(int *) shm_malloc(sizeof(int));
if (!probability) {
- LM_ERR("no shmem available\n");
+ SHM_MEM_ERROR;
return -1;
}
*probability = initial_prob;
gflags=(unsigned int *) shm_malloc(sizeof(unsigned int));
if (!gflags) {
- LM_ERR(" no shmem available\n");
+ SHM_MEM_ERROR;
+ shm_free(probability);
return -1;
}
*gflags=initial_gflags;