JosiahWI commented on code in PR #13876:
URL: https://github.com/apache/trafficserver/pull/13876#discussion_r4336296225


##########
src/iocore/cache/CacheWrite.cc:
##########
@@ -794,8 +794,8 @@ CacheVC::openWriteStartBegin(int /* event ATS_UNUSED */, 
Event * /* e ATS_UNUSED
   if (((err = stripe->open_write_lock(this, false, 1)) > 0)) {
     ts::Metrics::Counter::increment(cache_rsb.status[op_type].failure);
     
ts::Metrics::Counter::increment(stripe->cache_vol->vol_rsb.status[op_type].failure);
-    free_CacheVC(this);
     _action.continuation->handleEvent(CACHE_EVENT_OPEN_WRITE_FAILED, 
reinterpret_cast<void *>(-err));
+    free_CacheVC(this);
     return EVENT_DONE;

Review Comment:
   Holding the action pointer is not enough to cause a double free. The 
continuation doesn't receive the `CacheVC*` in this case, so while this concern 
makes sense in general, we can have fairly high confidence the continuation 
cannot free the `CacheVC`.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to