Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
try to catch some leaks
[simgrid.git] / examples / s4u / dht-chord / node.cpp
index 98058a2..02c37e4 100644 (file)
@@ -236,13 +236,13 @@ void Node::checkPredecessor()
   try {
     comm->wait(timeout);
     XBT_DEBUG("Received the answer to my 'Predecessor Alive': my predecessor %d is alive", pred_id_);
-    delete message;
   } catch (xbt_ex& e) {
     if (e.category == timeout_error) {
       XBT_DEBUG("Failed to receive the answer to my 'Predecessor Alive' request");
       pred_id_ = -1;
     }
   }
+  delete message;
 }
 
 /* Asks its predecessor to a remote node