From f725fc8f3f5a39291871d2645e1c99e1ebebd3ad Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Fri, 15 Nov 2013 13:00:43 +0000 Subject: [PATCH] - fix memleak on error (cov 10812) --- src/mesh/gnunet-service-mesh_connection.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index c4712f3f2..2749a7d09 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c @@ -1227,7 +1227,10 @@ GMC_handle_create (void *cls, const struct GNUNET_PeerIdentity *peer, LOG (GNUNET_ERROR_TYPE_DEBUG, " Creating connection\n"); c = GMC_new (cid, NULL, path_duplicate (path), own_pos); if (NULL == c) + { + path_destroy (path); return GNUNET_OK; + } connection_reset_timeout (c, GNUNET_YES); } else @@ -2087,6 +2090,7 @@ GMC_new (const struct GNUNET_HashCode *cid, { GNUNET_break (0); GMC_destroy (c); + path_destroy (p); return NULL; } c->own_pos = own_pos; -- 2.25.1