From: Arnaud Giersch Date: Wed, 6 Sep 2017 13:14:31 +0000 (+0200) Subject: Fix use-after-free. X-Git-Tag: v3_17~163 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b21ff70375d8bb1c8e7743cba50afe0fe6f3b909 Fix use-after-free. 'message' is not mine if I didn't get an answer. --- diff --git a/examples/s4u/dht-chord/node.cpp b/examples/s4u/dht-chord/node.cpp index b39c9f749d..d97b6b1c33 100644 --- a/examples/s4u/dht-chord/node.cpp +++ b/examples/s4u/dht-chord/node.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -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 static_cast(data); } 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