-fix rps service: prevent calling _request_cancel() twice
authorJulius Bünger <buenger@mytum.de>
Thu, 29 Sep 2016 23:46:25 +0000 (23:46 +0000)
committerJulius Bünger <buenger@mytum.de>
Thu, 29 Sep 2016 23:46:25 +0000 (23:46 +0000)
src/rps/gnunet-service-rps.c

index 11a2215c5714024feb56c67f72ced3d907010883..344140ce8cce47687aa8807db08d3b9eb9a664c0 100644 (file)
@@ -926,7 +926,10 @@ destroy_reply_cls (struct ReplyCls *rep_cls)
 
   cli_ctx = rep_cls->cli_ctx;
   GNUNET_assert (NULL != cli_ctx);
-  RPS_sampler_request_cancel (rep_cls->req_handle);
+  if (NULL != rep_cls->req_handle)
+  {
+    RPS_sampler_request_cancel (rep_cls->req_handle);
+  }
   GNUNET_CONTAINER_DLL_remove (cli_ctx->rep_cls_head,
                                cli_ctx->rep_cls_tail,
                                rep_cls);
@@ -1035,6 +1038,7 @@ client_respond (void *cls,
 
   cli_ctx = reply_cls->cli_ctx;
   GNUNET_assert (NULL != cli_ctx);
+  reply_cls->req_handle = NULL;
   destroy_reply_cls (reply_cls);
   GNUNET_MQ_send (cli_ctx->mq, ev);
 }