From: Bart Polot Date: Mon, 27 Aug 2012 15:50:25 +0000 (+0000) Subject: - leaks X-Git-Tag: initial-import-from-subversion-38251~12067 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7bb3c61cc23266e4ab91583f183dcb23f3d5c55e;p=oweals%2Fgnunet.git - leaks --- diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 4f032835e..44610d60e 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -3077,7 +3077,21 @@ tunnel_destroy_child (void *cls, const struct GNUNET_HashCode * key, void *value) { - GNUNET_free (value); + struct MeshTunnelChildInfo *cinfo = value; + struct MeshTunnel *t = cls; + unsigned int c; + unsigned int i; + + for (c = 0; c < cinfo->send_buffer_n; c++) + { + i = (cinfo->send_buffer_start + c) % t->fwd_queue_max; + if (NULL != cinfo->send_buffer[i]) + queue_destroy(cinfo->send_buffer[i], GNUNET_YES); + else + GNUNET_break (0); + } + GNUNET_free_non_null (cinfo->send_buffer); + GNUNET_free (cinfo); return GNUNET_YES; }