|
@@ -846,11 +846,6 @@ int dlg_new_dialog(struct sip_msg *req, struct cell *t, const int run_initial_cb
|
|
|
if_update_stat( dlg_enable_stats, processed_dlgs, 1);
|
|
|
|
|
|
finish:
|
|
|
-
|
|
|
- set_current_dialog(req, dlg);
|
|
|
- _dlg_ctx.dlg = dlg;
|
|
|
- ref_dlg(dlg, 1);
|
|
|
-
|
|
|
if (t) {
|
|
|
// transaction exists ==> keep ref counter large enough to
|
|
|
// avoid premature cleanup and ensure proper dialog referencing
|
|
@@ -870,10 +865,15 @@ finish:
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ set_current_dialog(req, dlg);
|
|
|
+ _dlg_ctx.dlg = dlg;
|
|
|
+ ref_dlg(dlg, 1);
|
|
|
+
|
|
|
return 0;
|
|
|
+
|
|
|
error:
|
|
|
- unref_dlg(dlg,1); // undo ref regarding linking
|
|
|
- profile_cleanup(req, 0, NULL); // undo ref regarding setting current dialog
|
|
|
+ if (!spiral_detected)
|
|
|
+ unref_dlg(dlg,1); // undo ref regarding linking
|
|
|
return -1;
|
|
|
}
|
|
|
|