Fixed memory leak
authorBart Polot <bart@net.in.tum.de>
Mon, 19 Sep 2011 22:09:18 +0000 (22:09 +0000)
committerBart Polot <bart@net.in.tum.de>
Mon, 19 Sep 2011 22:09:18 +0000 (22:09 +0000)
src/mesh/gnunet-service-mesh.c

index 1fd5165e283aaf02edb98750af2c3b744576e3e7..a793a444e8e6d2df8b807db2cb1efc857437b277 100644 (file)
@@ -3419,12 +3419,12 @@ core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: Peer connected\n");
   peer_info = peer_info_get (peer);
-  path = GNUNET_malloc (sizeof (struct MeshPeerPath));
   if (myid == peer_info->id)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH:      (self)\n");
     return;
   }
+  path = GNUNET_malloc (sizeof (struct MeshPeerPath));
   path->length = 2;
   path->peers = GNUNET_malloc (sizeof (GNUNET_PEER_Id) * 2);
   path->peers[0] = myid;