Module: kamailio Branch: master Commit: b7d42f248bef70a06d8ae23f4a7652fd3f0e4e61 URL: https://github.com/kamailio/kamailio/commit/b7d42f248bef70a06d8ae23f4a7652fd...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2020-11-27T07:49:27+01:00
core: test if shm is initialized on early shutdown
---
Modified: src/core/sr_module.c
---
Diff: https://github.com/kamailio/kamailio/commit/b7d42f248bef70a06d8ae23f4a7652fd... Patch: https://github.com/kamailio/kamailio/commit/b7d42f248bef70a06d8ae23f4a7652fd...
---
diff --git a/src/core/sr_module.c b/src/core/sr_module.c index 56ba8bca59..ba6406ba46 100644 --- a/src/core/sr_module.c +++ b/src/core/sr_module.c @@ -43,6 +43,7 @@ #include "sr_compat.h" #include "ppcfg.h" #include "async_task.h" +#include "shm_init.h"
#include <sys/stat.h> #include <regex.h> @@ -114,7 +115,7 @@ static int *_ksr_shutdown_phase = NULL;
int ksr_shutdown_phase_init(void) { - if(_ksr_shutdown_phase == NULL) { + if((_ksr_shutdown_phase == NULL) && (shm_initialized())) { _ksr_shutdown_phase = (int*)shm_malloc(sizeof(int)); } return 0;