Skip to content

Commit 4c5a0e7

Browse files
authored
Merge pull request #91 from freeswitch/stack_shutdown_crash
Fix crash on nua stack shutdown.
2 parents afa7ebb + 07b989c commit 4c5a0e7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

libsofia-sip-ua/nua/nua_dialog.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,14 @@ int nua_dialog_repeat_shutdown(nua_owner_t *owner, nua_dialog_state_t *ds)
650650
if (nua_server_request_is_pending(sr)) {
651651
SR_STATUS1(sr, SIP_410_GONE); /* 410 terminates dialog */
652652
nua_server_respond(sr, NULL);
653-
nua_server_report(sr);
653+
if (nua_server_report(sr) > 2) {
654+
/*
655+
Dialog was destroyed if nua_base_server_report() returned 3 or 4.
656+
All references (sr) are cleared from queued server requests at this point.
657+
See nua_dialog_deinit() and nua_dialog_usage_remove_at()
658+
*/
659+
break;
660+
}
654661
}
655662
}
656663

0 commit comments

Comments
 (0)