- docs
[oweals/gnunet.git] / src / testbed / gnunet-service-testbed_peers.c
index 34c1bf085bffd129d158cade9d50719525a5254b..c07fa87c5419d2616e0b00cc1a4583f04e4b76f7 100644 (file)
@@ -774,7 +774,7 @@ GST_free_prcq ()
  * Callback to inform whether the peer is running or stopped.
  *
  * @param cls the closure given to GNUNET_TESTING_peer_stop_async()
- * @param peer the respective peer whose status is being reported
+ * @param p the respective peer whose status is being reported
  * @param success GNUNET_YES if the peer is stopped; GNUNET_SYSERR upon any
  *          error
  */
@@ -1273,8 +1273,12 @@ shutdown_peers_timeout_cb (void *cls,
   GNUNET_assert (0 < hc->nslaves);
   hc->nslaves--;
   if (0 == hc->nslaves)
+  {
     GST_send_operation_fail_msg (fo_ctxt->client, fo_ctxt->operation_id,
                                  "Timeout at a slave controller");
+    GNUNET_free (hc);
+    hc = NULL;
+  }
   GNUNET_TESTBED_forward_operation_msg_cancel_ (fo_ctxt->opc);  
   GNUNET_SERVER_client_drop (fo_ctxt->client);
   GNUNET_CONTAINER_DLL_remove (fopcq_head, fopcq_tail, fo_ctxt);
@@ -1313,6 +1317,8 @@ shutdown_peers_reply_cb (void *cls,
                                    "Timeout at a slave controller");
     else
       GST_send_operation_success_msg (fo_ctxt->client, fo_ctxt->operation_id);
+    GNUNET_free (hc);
+    hc = NULL;
   }
   GNUNET_SERVER_client_drop (fo_ctxt->client);
   GNUNET_CONTAINER_DLL_remove (fopcq_head, fopcq_tail, fo_ctxt);