From: Andrey Volk Date: Mon, 30 Nov 2020 18:24:21 +0000 (+0400) Subject: [mod_sofia] Properly handle nua events came without nua handles. X-Git-Tag: v1.10.6^2~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b78c9a115e4ce43e7d37c65816c82f078fd6466c;p=thirdparty%2Ffreeswitch.git [mod_sofia] Properly handle nua events came without nua handles. --- 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;