You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/07/30 15:28:29 UTC

[GitHub] [trafficserver] SolidWallOfCode commented on a change in pull request #8184: Fix a use-after-free reported by clang-analyzer

SolidWallOfCode commented on a change in pull request #8184:
URL: https://github.com/apache/trafficserver/pull/8184#discussion_r680014788



##########
File path: iocore/net/UnixNetVConnection.cc
##########
@@ -990,6 +993,23 @@ UnixNetVConnection::netActivity(EThread *lthread)
   net_activity(this, lthread);
 }
 
+int
+UnixNetVConnection::startEvent(int /* event ATS_UNUSED */, Event *e)
+{
+  MUTEX_TRY_LOCK(lock, get_NetHandler(e->ethread)->mutex, e->ethread);
+  if (!lock.is_locked()) {
+    e->schedule_in(HRTIME_MSECONDS(net_retry_delay));
+    return EVENT_CONT;
+  }
+  if (!action_.cancelled) {
+    connectUp(e->ethread, NO_FD);
+  } else {
+    lock.release();

Review comment:
       I don't see how the early release helps, nor how it would double free. The lock remembers state so it won't try to release the lock again.




-- 
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