Skip to content

Commit 9bc875e

Browse files
jasnelladuh95
authored andcommitted
quic: fix premature unref of endpoint when listening
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #63267 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent f940d6b commit 9bc875e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/quic/endpoint.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,9 @@ void Endpoint::RemoveSession(const CID& cid,
735735
}
736736
}
737737
if (primary_session_count_ > 0 && --primary_session_count_ == 0) {
738-
udp_.Unref();
738+
if (!is_listening()) {
739+
udp_.Unref();
740+
}
739741
session_manager().RemoveSession(cid);
740742
// The endpoint may be idle (no sessions, not listening). MaybeDestroy
741743
// handles both closing (immediate destroy) and idle timeout (start

0 commit comments

Comments
 (0)