aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_peer.c
diff options
context:
space:
mode:
authorCarlo von lynX <lynX@time.to.get.psyced.org>2016-07-29 00:35:41 +0000
committerCarlo von lynX <lynX@time.to.get.psyced.org>2016-07-29 00:35:41 +0000
commitc944678c3cc79704d6e16a0790e3044c0fb334a2 (patch)
treebbe2459b7483c74676fb2bad2ffb6b29580ca6ba /src/cadet/gnunet-service-cadet_peer.c
parent01a8bbfb74277d3dd7f1c0e24f7ed61554658fd6 (diff)
downloadgnunet-c944678c3cc79704d6e16a0790e3044c0fb334a2.tar.gz
gnunet-c944678c3cc79704d6e16a0790e3044c0fb334a2.zip
fixed a memleak, a static string free, an access of freed memory etc
Diffstat (limited to 'src/cadet/gnunet-service-cadet_peer.c')
-rw-r--r--src/cadet/gnunet-service-cadet_peer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c
index e19c3ca48..fa338f13f 100644
--- a/src/cadet/gnunet-service-cadet_peer.c
+++ b/src/cadet/gnunet-service-cadet_peer.c
@@ -787,7 +787,12 @@ peer_destroy (struct CadetPeer *peer)
787 GNUNET_ATS_connectivity_suggest_cancel (peer->connectivity_suggestion); 787 GNUNET_ATS_connectivity_suggest_cancel (peer->connectivity_suggestion);
788 peer->connectivity_suggestion = NULL; 788 peer->connectivity_suggestion = NULL;
789 } 789 }
790 while (NULL != peer->queue_head) 790 /* Following check was 'while' instead of 'if', but GCP_queue_destroy
791 * frees 'peer->queue_head' so the while checks on freed memory.
792 * Not sure if 'if' is what you wanted, but 'while' can't be
793 * correct. --lynX
794 */
795 if (NULL != peer->queue_head)
791 { 796 {
792 GCP_queue_destroy (peer->queue_head, GNUNET_YES, GNUNET_NO, 0); 797 GCP_queue_destroy (peer->queue_head, GNUNET_YES, GNUNET_NO, 0);
793 } 798 }