From 41e1c58c1953ad8376b9e9f247d94abd313b4ae8 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Wed, 28 Jan 2015 19:01:56 +0000 Subject: [PATCH] - avoid NPE --- src/rps/gnunet-service-rps.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index fe5db5e6f..4782a69df 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c @@ -1542,6 +1542,10 @@ cleanup_channel (void *cls, RPS_sampler_reinitialise_by_value (peer); peer_ctx = GNUNET_CONTAINER_multipeermap_get (peer_map, peer); + + if (NULL == peer_ctx) /* It could have been removed by shutdown_task */ + return; + /* Somwewhat {ab,re}use the iterator function */ /* Cast to void is ok, because it's used as void in peer_remove_cb */ (void) peer_remove_cb ((void *) channel, peer, peer_ctx); -- 2.25.1