diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-01-26 13:23:49 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-01-26 13:23:49 +0000 |
commit | 162fbcf543a045b2046cbe8bfe5113c12fa22105 (patch) | |
tree | 39f7f24433b244447b9a65706f4e2baf9248a7af /src/ats | |
parent | c165706a3736d5b0a572f3a15c8c7b510c95961b (diff) | |
download | gnunet-162fbcf543a045b2046cbe8bfe5113c12fa22105.tar.gz gnunet-162fbcf543a045b2046cbe8bfe5113c12fa22105.zip |
cppcheck
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/ats_api.c | 8 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_addresses_mlp.c | 17 |
2 files changed, 8 insertions, 17 deletions
diff --git a/src/ats/ats_api.c b/src/ats/ats_api.c index 7c0fb2d32..82eede9dc 100644 --- a/src/ats/ats_api.c +++ b/src/ats/ats_api.c | |||
@@ -252,14 +252,6 @@ suggest_address (void *cls, const GNUNET_HashCode * key, void *value) | |||
252 | return GNUNET_NO; | 252 | return GNUNET_NO; |
253 | } | 253 | } |
254 | 254 | ||
255 | |||
256 | int | ||
257 | map_it (void *cls, const GNUNET_HashCode * key, void *value) | ||
258 | { | ||
259 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Found entry for %s\n", GNUNET_h2s (key)); | ||
260 | return GNUNET_YES; | ||
261 | } | ||
262 | |||
263 | /** | 255 | /** |
264 | * We would like to establish a new connection with a peer. | 256 | * We would like to establish a new connection with a peer. |
265 | * ATS should suggest a good address to begin with. | 257 | * ATS should suggest a good address to begin with. |
diff --git a/src/ats/gnunet-service-ats_addresses_mlp.c b/src/ats/gnunet-service-ats_addresses_mlp.c index 3c57110f5..602925e1f 100644 --- a/src/ats/gnunet-service-ats_addresses_mlp.c +++ b/src/ats/gnunet-service-ats_addresses_mlp.c | |||
@@ -1418,6 +1418,8 @@ GAS_mlp_done (struct GAS_MLP_Handle *mlp) | |||
1418 | struct ATS_Peer * peer; | 1418 | struct ATS_Peer * peer; |
1419 | struct ATS_Peer * tmp; | 1419 | struct ATS_Peer * tmp; |
1420 | 1420 | ||
1421 | GNUNET_assert (mlp != NULL); | ||
1422 | |||
1421 | if (mlp->mlp_task != GNUNET_SCHEDULER_NO_TASK) | 1423 | if (mlp->mlp_task != GNUNET_SCHEDULER_NO_TASK) |
1422 | { | 1424 | { |
1423 | GNUNET_SCHEDULER_cancel(mlp->mlp_task); | 1425 | GNUNET_SCHEDULER_cancel(mlp->mlp_task); |
@@ -1425,16 +1427,13 @@ GAS_mlp_done (struct GAS_MLP_Handle *mlp) | |||
1425 | } | 1427 | } |
1426 | 1428 | ||
1427 | /* clean up peer list */ | 1429 | /* clean up peer list */ |
1428 | if (mlp != NULL) | 1430 | peer = mlp->peer_head; |
1431 | while (peer != NULL) | ||
1429 | { | 1432 | { |
1430 | peer = mlp->peer_head; | 1433 | GNUNET_CONTAINER_DLL_remove(mlp->peer_head, mlp->peer_tail, peer); |
1431 | while (peer != NULL) | 1434 | tmp = peer->next; |
1432 | { | 1435 | GNUNET_free (peer); |
1433 | GNUNET_CONTAINER_DLL_remove(mlp->peer_head, mlp->peer_tail, peer); | 1436 | peer = tmp; |
1434 | tmp = peer->next; | ||
1435 | GNUNET_free (peer); | ||
1436 | peer = tmp; | ||
1437 | } | ||
1438 | } | 1437 | } |
1439 | mlp_delete_problem (mlp); | 1438 | mlp_delete_problem (mlp); |
1440 | 1439 | ||