qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Fabbri <ajfab...@gmail.com>
Subject patch: Don't access after delete in RdmaServer.cpp
Date Wed, 06 Oct 2010 02:10:51 GMT
Just noticed this when reading the Rdma transport unit test code:

Index: RdmaServer.cpp
===================================================================
--- RdmaServer.cpp      (revision 1004875)
+++ RdmaServer.cpp      (working copy)
@@ -118,18 +118,18 @@
     ConRec* cr = ci->getContext<ConRec>();
     cr->connection->disconnect();
     cr->data->drainWriteQueue(drained);
+    cout << "Disconnected: " << cr << "\n";
     delete cr;
-    cout << "Disconnected: " << cr << "\n";
 }

 void connectionError(Rdma::Connection::intrusive_ptr& ci, Rdma::ErrorType) {
     ConRec* cr = ci->getContext<ConRec>();
     cr->connection->disconnect();
+    cout << "Connection error: " << cr << "\n";
     if (cr) {
         cr->data->drainWriteQueue(drained);
         delete cr;
     }
-    cout << "Connection error: " << cr << "\n";
 }

 bool connectionRequest(Rdma::Connection::intrusive_ptr& ci,  const
Rdma::ConnectionParams& cp) {

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Mime
View raw message