diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-09-21 19:51:37 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-09-21 19:51:37 +0000 |
commit | 739aec3d1590e7c80d1322608781cf140c0e9f6a (patch) | |
tree | 41cb6387fd9ca8726cddcd320d6ec73b020b575d /src/mesh/test_mesh_path_api.c | |
parent | d3efb620d2503fce79fb4772ce6cc5eefde3a740 (diff) | |
download | gnunet-739aec3d1590e7c80d1322608781cf140c0e9f6a.tar.gz gnunet-739aec3d1590e7c80d1322608781cf140c0e9f6a.zip |
Fixed memory leaks
Diffstat (limited to 'src/mesh/test_mesh_path_api.c')
-rw-r--r-- | src/mesh/test_mesh_path_api.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesh/test_mesh_path_api.c b/src/mesh/test_mesh_path_api.c index fc073df5f..d033d0c83 100644 --- a/src/mesh/test_mesh_path_api.c +++ b/src/mesh/test_mesh_path_api.c | |||
@@ -42,7 +42,7 @@ struct MeshTunnelTree *tree; | |||
42 | void | 42 | void |
43 | cb (const struct MeshTunnelTreeNode *n) | 43 | cb (const struct MeshTunnelTreeNode *n) |
44 | { | 44 | { |
45 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "test: Desconnected %u\n", n->peer); | 45 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "test: Disconnected %u\n", n->peer); |
46 | if(0 == cb_call) | 46 | if(0 == cb_call) |
47 | { | 47 | { |
48 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "test: and it shouldn't!\n"); | 48 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "test: and it shouldn't!\n"); |
@@ -118,7 +118,6 @@ main (int argc, char *argv[]) | |||
118 | path->length = 4; | 118 | path->length = 4; |
119 | 119 | ||
120 | tree_add_path(tree, path, &cb); | 120 | tree_add_path(tree, path, &cb); |
121 | finish(); | ||
122 | path1 = tree_get_path_to_peer(tree, 3); | 121 | path1 = tree_get_path_to_peer(tree, 3); |
123 | if (path->length != path1->length || | 122 | if (path->length != path1->length || |
124 | memcmp(path->peers, path1->peers, path->length) != 0) | 123 | memcmp(path->peers, path1->peers, path->length) != 0) |
@@ -138,13 +137,11 @@ main (int argc, char *argv[]) | |||
138 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Retrieved peer wrong status!\n"); | 137 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Retrieved peer wrong status!\n"); |
139 | failed++; | 138 | failed++; |
140 | } | 139 | } |
141 | node->status = MESH_PEER_READY; | ||
142 | if (GNUNET_PEER_search(path_get_first_hop(tree, 3)) != 1) | 140 | if (GNUNET_PEER_search(path_get_first_hop(tree, 3)) != 1) |
143 | { | 141 | { |
144 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Wrong first hop!\n"); | 142 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Wrong first hop!\n"); |
145 | failed++; | 143 | failed++; |
146 | } | 144 | } |
147 | return 0; | ||
148 | 145 | ||
149 | node = tree_find_peer(tree->root, 2); | 146 | node = tree_find_peer(tree->root, 2); |
150 | if (node->peer != 2) | 147 | if (node->peer != 2) |
@@ -187,7 +184,10 @@ main (int argc, char *argv[]) | |||
187 | 184 | ||
188 | path->length--; | 185 | path->length--; |
189 | tree_add_path(tree, path, &cb); | 186 | tree_add_path(tree, path, &cb); |
190 | 187 | path->length++; | |
188 | path_destroy(path); | ||
189 | finish(); | ||
190 | |||
191 | node = tree_find_peer(tree->root, 2); | 191 | node = tree_find_peer(tree->root, 2); |
192 | if (node->peer != 2) | 192 | if (node->peer != 2) |
193 | { | 193 | { |