]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_sofia] Properly handle nua events came without nua handles.
authorAndrey Volk <andywolk@gmail.com>
Mon, 30 Nov 2020 18:24:21 +0000 (22:24 +0400)
committerAndrey Volk <andywolk@gmail.com>
Wed, 17 Mar 2021 15:31:42 +0000 (18:31 +0300)
src/mod/endpoints/mod_sofia/sofia.c

index 7e71717aff965fce4e44880272e5b735d8ec88de..dcedbc7e43cf246e32bc99beb817ab6e28656f79 100644 (file)
@@ -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;