Skip to content

Commit 605c4e1

Browse files
committed
Fixed clang-analyzer issue with calling schedule_imm with the continuation
possibly being a nullptr
1 parent f7131e4 commit 605c4e1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

proxy/http2/Http2Stream.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,13 @@ Http2Stream::main_event_handler(int event, void *edata)
9292
inactive_timeout_at = Thread::get_hrtime() + inactive_timeout;
9393
if (e->cookie == &write_vio) {
9494
if (write_vio.mutex) {
95-
MUTEX_TRY_LOCK(lock, write_vio.mutex, this_ethread());
96-
if (lock.is_locked() && write_vio.cont && this->current_reader) {
97-
write_vio.cont->handleEvent(event, &write_vio);
98-
} else {
99-
this_ethread()->schedule_imm(write_vio.cont, event, &write_vio);
95+
if (write_vio.cont && this->current_reader) {
96+
MUTEX_TRY_LOCK(lock, write_vio.mutex, this_ethread());
97+
if (lock.is_locked()) {
98+
write_vio.cont->handleEvent(event, &write_vio);
99+
} else {
100+
this_ethread()->schedule_imm(write_vio.cont, event, &write_vio);
101+
}
100102
}
101103
}
102104
} else {

0 commit comments

Comments
 (0)