Module: kamailio
Branch: master
Commit: 6b3d6842b0f5706a5b3612104bd0ceab073f1cbc
URL:
https://github.com/kamailio/kamailio/commit/6b3d6842b0f5706a5b3612104bd0cea…
Author: Carsten Bock <carsten(a)ng-voice.com>
Committer: Carsten Bock <carsten(a)ng-voice.com>
Date: 2015-01-22T13:51:17+02:00
ims_registrar_pcscf: Make sure, that the event list is initialized.
---
Modified: modules/ims_registrar_pcscf/async_reginfo.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6b3d6842b0f5706a5b3612104bd0cea…
Patch:
https://github.com/kamailio/kamailio/commit/6b3d6842b0f5706a5b3612104bd0cea…
---
diff --git a/modules/ims_registrar_pcscf/async_reginfo.c
b/modules/ims_registrar_pcscf/async_reginfo.c
index 2403722..c037f74 100644
--- a/modules/ims_registrar_pcscf/async_reginfo.c
+++ b/modules/ims_registrar_pcscf/async_reginfo.c
@@ -56,6 +56,9 @@ reginfo_event_list_t *reginfo_event_list = 0;
int init_reginfo_event_list()
{
+ if (reginfo_event_list)
+ return 1;
+
reginfo_event_list = shm_malloc(sizeof(reginfo_event_list_t));
if (!reginfo_event_list) {
LM_ERR("No more SHM mem\n");
@@ -242,6 +245,9 @@ reginfo_event_t* pop_reginfo_event()
{
reginfo_event_t *ev;
+ // Make sure, it's initialized:
+ init_reginfo_event_list();
+
lock_get(reginfo_event_list->lock);
while (reginfo_event_list->head == 0) {
lock_release(reginfo_event_list->lock);