]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_sofia] Calling direct _unref() functions in sofia_event_callback() is unsafe.
authorAndrey Volk <andywolk@gmail.com>
Wed, 16 Jun 2021 08:18:15 +0000 (11:18 +0300)
committerAndrey Volk <andywolk@gmail.com>
Thu, 17 Jun 2021 00:17:13 +0000 (03:17 +0300)
src/mod/endpoints/mod_sofia/sofia.c

index 9ebd0ee35fdebfeafc409d9835c831086ae2a60f..70ed479ab5e1f6642b157e55ebb59cb1c08dd993 100644 (file)
@@ -2581,8 +2581,8 @@ void sofia_event_callback(nua_event_t event,
                        profile->queued_events--;
                        switch_mutex_unlock(profile->flag_mutex);
 
-                       nua_handle_unref(nh);
-                       nua_unref(nua);
+                       nua_handle_unref_user(nh);
+                       nua_unref_user(nua);
 
                        goto end;
                }
@@ -2619,8 +2619,8 @@ void sofia_event_callback(nua_event_t event,
                        profile->queued_events--;
                        switch_mutex_unlock(profile->flag_mutex);
 
-                       nua_handle_unref(nh);
-                       nua_unref(nua);
+                       nua_handle_unref_user(nh);
+                       nua_unref_user(nua);
 
                        goto end;
                }