From: Carlo von lynX Date: Fri, 29 Jul 2016 21:17:38 +0000 (+0000) Subject: cadet: rollback + warning message for posterity X-Git-Tag: initial-import-from-subversion-38251~467 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a0d960700a3dca5bf07f0cc1dc13a1801c4a7c3b;p=oweals%2Fgnunet.git cadet: rollback + warning message for posterity --- diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c index fa338f13f..f9117953d 100644 --- a/src/cadet/gnunet-service-cadet_peer.c +++ b/src/cadet/gnunet-service-cadet_peer.c @@ -787,13 +787,12 @@ peer_destroy (struct CadetPeer *peer) GNUNET_ATS_connectivity_suggest_cancel (peer->connectivity_suggestion); peer->connectivity_suggestion = NULL; } - /* Following check was 'while' instead of 'if', but GCP_queue_destroy - * frees 'peer->queue_head' so the while checks on freed memory. - * Not sure if 'if' is what you wanted, but 'while' can't be - * correct. --lynX - */ - if (NULL != peer->queue_head) + while (NULL != peer->queue_head) { + /* This function destroys the current peer->queue_head but + * replaces it with the next in the queue, so it is correct + * to while() here. + */ GCP_queue_destroy (peer->queue_head, GNUNET_YES, GNUNET_NO, 0); } if (NULL != peer->core_transmit)