From 411abad7976fb483fb29bddd8982cbe746502b95 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20B=C3=BCnger?= Date: Thu, 5 Jul 2018 22:05:16 +0200 Subject: [PATCH] rps profiler: additional checks and assertions before disconnect from rps --- src/rps/gnunet-rps-profiler.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c index dcd72aef1..0427608f1 100644 --- a/src/rps/gnunet-rps-profiler.c +++ b/src/rps/gnunet-rps-profiler.c @@ -1177,8 +1177,12 @@ rps_disconnect_adapter (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnect_adapter()\n"); GNUNET_assert (NULL != peer); - GNUNET_RPS_disconnect (h); - peer->rps_handle = NULL; + if (NULL != peer->rps_handle) + { + GNUNET_assert (h == peer->rps_handle); + GNUNET_RPS_disconnect (h); + peer->rps_handle = NULL; + } } -- 2.25.1