File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1194,7 +1194,12 @@ TEST_CASE(h2_sm_mock_cancel_after_goaway_no_double_complete) {
11941194 * and the cancel cross-thread task will run, causing double on_complete. */
11951195 aws_http_stream_cancel_default_error (stream );
11961196
1197- /* Drain tasks - this should NOT crash from double stream completion */
1197+ /* User releases their ref on the stream (simulates real usage: cancel then release).
1198+ * The stream must stay alive until the cross-thread task completes. */
1199+ aws_http_stream_release (stream );
1200+ aws_array_list_clear (& s_tester .streams );
1201+
1202+ /* Drain tasks - this should NOT crash from double stream completion or use-after-free */
11981203 testing_channel_drain_queued_tasks (& fake_connection -> testing_channel );
11991204
12001205 /* Stream should be completed with error at least once */
You can’t perform that action at this time.
0 commit comments