diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-11-10 12:39:32 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-11-10 12:39:32 +0000 |
commit | e1e25c0c4828c2d8c93f4ede4191de3895592aab (patch) | |
tree | 077618b878e885c10b3af61bdb708b551a538eac /src/dht/gnunet-service-dht.c | |
parent | f2d0582c044e1c7ea338db930fe002d2f41841b0 (diff) | |
download | gnunet-e1e25c0c4828c2d8c93f4ede4191de3895592aab.tar.gz gnunet-e1e25c0c4828c2d8c93f4ede4191de3895592aab.zip |
codesonar fixes
Diffstat (limited to 'src/dht/gnunet-service-dht.c')
-rw-r--r-- | src/dht/gnunet-service-dht.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index d74309e21..ae57c0ea7 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c | |||
@@ -1672,7 +1672,7 @@ static void forward_message (const struct GNUNET_MessageHeader *msg, | |||
1672 | size_t psize; | 1672 | size_t psize; |
1673 | 1673 | ||
1674 | increment_stats(STAT_ROUTE_FORWARDS); | 1674 | increment_stats(STAT_ROUTE_FORWARDS); |
1675 | 1675 | GNUNET_assert(peer != NULL); | |
1676 | if ((msg_ctx->closest != GNUNET_YES) && (peer == find_closest_peer(&msg_ctx->key))) | 1676 | if ((msg_ctx->closest != GNUNET_YES) && (peer == find_closest_peer(&msg_ctx->key))) |
1677 | increment_stats(STAT_ROUTE_FORWARDS_CLOSEST); | 1677 | increment_stats(STAT_ROUTE_FORWARDS_CLOSEST); |
1678 | 1678 | ||
@@ -2434,6 +2434,7 @@ handle_dht_find_peer (const struct GNUNET_MessageHeader *find_msg, | |||
2434 | else /* We don't want this peer! */ | 2434 | else /* We don't want this peer! */ |
2435 | { | 2435 | { |
2436 | route_message (find_msg, message_context); | 2436 | route_message (find_msg, message_context); |
2437 | GNUNET_free (other_hello); | ||
2437 | return; | 2438 | return; |
2438 | } | 2439 | } |
2439 | #endif | 2440 | #endif |
@@ -2512,6 +2513,7 @@ handle_dht_find_peer (const struct GNUNET_MessageHeader *find_msg, | |||
2512 | } | 2513 | } |
2513 | else | 2514 | else |
2514 | { | 2515 | { |
2516 | GNUNET_free(recent_hash); | ||
2515 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Received duplicate find peer request too soon!\n"); | 2517 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Received duplicate find peer request too soon!\n"); |
2516 | } | 2518 | } |
2517 | 2519 | ||
@@ -3912,7 +3914,6 @@ malicious_get_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
3912 | get_message.header.type = htons(GNUNET_MESSAGE_TYPE_DHT_GET); | 3914 | get_message.header.type = htons(GNUNET_MESSAGE_TYPE_DHT_GET); |
3913 | get_message.type = htonl(GNUNET_BLOCK_DHT_MALICIOUS_MESSAGE_TYPE); | 3915 | get_message.type = htonl(GNUNET_BLOCK_DHT_MALICIOUS_MESSAGE_TYPE); |
3914 | memset(&message_context, 0, sizeof(struct DHT_MessageContext)); | 3916 | memset(&message_context, 0, sizeof(struct DHT_MessageContext)); |
3915 | message_context.client = NULL; | ||
3916 | random_key = GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, (uint32_t)-1); | 3917 | random_key = GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, (uint32_t)-1); |
3917 | GNUNET_CRYPTO_hash(&random_key, sizeof(uint32_t), &key); | 3918 | GNUNET_CRYPTO_hash(&random_key, sizeof(uint32_t), &key); |
3918 | memcpy(&message_context.key, &key, sizeof(GNUNET_HashCode)); | 3919 | memcpy(&message_context.key, &key, sizeof(GNUNET_HashCode)); |
@@ -4539,6 +4540,7 @@ void handle_core_disconnect (void *cls, | |||
4539 | increment_stats(STAT_DISCONNECTS); | 4540 | increment_stats(STAT_DISCONNECTS); |
4540 | GNUNET_assert(GNUNET_CONTAINER_multihashmap_contains(all_known_peers, &peer->hashPubKey)); | 4541 | GNUNET_assert(GNUNET_CONTAINER_multihashmap_contains(all_known_peers, &peer->hashPubKey)); |
4541 | to_remove = GNUNET_CONTAINER_multihashmap_get(all_known_peers, &peer->hashPubKey); | 4542 | to_remove = GNUNET_CONTAINER_multihashmap_get(all_known_peers, &peer->hashPubKey); |
4543 | GNUNET_assert (to_remove != NULL); | ||
4542 | GNUNET_assert(0 == memcmp(peer, &to_remove->id, sizeof(struct GNUNET_PeerIdentity))); | 4544 | GNUNET_assert(0 == memcmp(peer, &to_remove->id, sizeof(struct GNUNET_PeerIdentity))); |
4543 | current_bucket = find_current_bucket(&to_remove->id.hashPubKey); | 4545 | current_bucket = find_current_bucket(&to_remove->id.hashPubKey); |
4544 | delete_peer(to_remove, current_bucket); | 4546 | delete_peer(to_remove, current_bucket); |