You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "maskit (via GitHub)" <gi...@apache.org> on 2023/02/07 23:10:45 UTC

[GitHub] [trafficserver] maskit commented on a diff in pull request #9346: Make Http3App class responsible for H3 transaction creation/deletion

maskit commented on code in PR #9346:
URL: https://github.com/apache/trafficserver/pull/9346#discussion_r1099388377


##########
proxy/http3/Http3Session.cc:
##########
@@ -38,8 +38,13 @@ HQSession::HQSession(NetVConnection *vc) : ProxySession(vc)
 
 HQSession::~HQSession()
 {
-  for (HQTransaction *t = this->_transaction_list.head; t; t = static_cast<HQTransaction *>(t->link.next)) {
-    delete t;
+  // Transactions should be deleted first before HQSesson gets deleted.
+  // Delete remaining transactions just to prevent leaks.
+  HQTransaction *t = this->_transaction_list.head;
+  while (t) {
+    ink_assert(t);
+    auto x = t;

Review Comment:
   I realized we can't simply do `t->link.next` because it's already deleted.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org