From: Bart Polot Date: Fri, 15 Nov 2013 13:00:43 +0000 (+0000) Subject: - fix memleak on error (cov 10812) X-Git-Tag: initial-import-from-subversion-38251~6084 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f725fc8f3f5a39291871d2645e1c99e1ebebd3ad;p=oweals%2Fgnunet.git - fix memleak on error (cov 10812) --- 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;