From b78c9a115e4ce43e7d37c65816c82f078fd6466c Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Mon, 30 Nov 2020 22:24:21 +0400 Subject: [PATCH] [mod_sofia] Properly handle nua events came without nua handles. --- src/mod/endpoints/mod_sofia/sofia.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 7e71717aff..dcedbc7e43 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -2282,7 +2282,7 @@ void sofia_process_dispatch_event(sofia_dispatch_event_t **dep) profile->queued_events--; switch_mutex_unlock(profile->flag_mutex); - nua_handle_unref(nh); + if (nh) nua_handle_unref(nh); nua_unref(nua); } @@ -2516,7 +2516,7 @@ void sofia_event_callback(nua_event_t event, de = su_alloc(nua_handle_get_home(nh), sizeof(*de)); memset(de, 0, sizeof(*de)); nua_save_event(nua, de->event); - de->nh = nua_handle_ref(nh); + de->nh = nh ? nua_handle_ref(nh) : NULL; de->data = nua_event_data(de->event); de->sip = sip_object(de->data->e_msg); de->profile = profile;