From 62429679c3b5b45fd1e25d19957ef2e6193b6227 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 5 Dec 2013 22:03:49 +0000 Subject: [PATCH] -fix leak, use 'op' --- src/testbed/gnunet-service-testbed_peers.c | 9 +++++---- src/testbed/test_testbed_api_peers_manage_services.c | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/testbed/gnunet-service-testbed_peers.c b/src/testbed/gnunet-service-testbed_peers.c index 998ab81c6..88c8c8231 100644 --- a/src/testbed/gnunet-service-testbed_peers.c +++ b/src/testbed/gnunet-service-testbed_peers.c @@ -361,7 +361,7 @@ GST_handle_peer_create (void *cls, struct GNUNET_SERVER_Client *client, } GNUNET_CONFIGURATION_set_value_number (cfg, "TESTBED", "PEERID", (unsigned long long) peer_id); - + GNUNET_CONFIGURATION_set_value_number (cfg, "PATHS", "PEERID", (unsigned long long) peer_id); peer = GNUNET_malloc (sizeof (struct Peer)); @@ -798,7 +798,7 @@ update_peer_config (struct Peer *peer, GNUNET_TESTING_peer_destroy (peer->details.local.peer); GNUNET_CONFIGURATION_destroy (peer->details.local.cfg); peer->details.local.cfg = cfg; - emsg = NULL; + emsg = NULL; peer->details.local.peer = GNUNET_TESTING_peer_configure (GST_context->system, peer->details.local.cfg, peer->id, @@ -943,17 +943,18 @@ GST_handle_peer_reconfigure (void *cls, struct GNUNET_SERVER_Client *client, return; } prc = GNUNET_malloc (sizeof (struct PeerReconfigureContext)); - if (GNUNET_OK != + if (GNUNET_OK != GNUNET_TESTING_peer_stop_async (peer->details.local.peer, &prc_stop_cb, prc)) { GNUNET_assert (0 < GNUNET_asprintf (&emsg, - "Error trying to stop peer %u asynchronously\n", + "Error trying to stop peer %u asynchronously\n", peer_id)); LOG (GNUNET_ERROR_TYPE_ERROR, "%s\n", emsg); GST_send_operation_fail_msg (client, op_id, emsg); GNUNET_SERVER_receive_done (client, GNUNET_OK); GNUNET_free (prc); + GNUNET_free (emsg); return; } prc->cfg = cfg; diff --git a/src/testbed/test_testbed_api_peers_manage_services.c b/src/testbed/test_testbed_api_peers_manage_services.c index d0677cc21..63c089e19 100644 --- a/src/testbed/test_testbed_api_peers_manage_services.c +++ b/src/testbed/test_testbed_api_peers_manage_services.c @@ -146,6 +146,7 @@ op_comp_cb (void *cls, op_comp_cb, dummy_cls, 0); + GNUNET_assert (NULL != op); break; case STATE_SERVICE_DOWN: state = STATE_SERVICE_UP; -- 2.25.1