diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-12-12 13:56:26 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-12-12 13:56:26 +0000 |
commit | 5c0b58109855f17232a0f00bf3ac613487b09015 (patch) | |
tree | e7e0f327b027051fc6298b937be9f36386b027e8 /src/dht | |
parent | e4f125ab6bb57e7b99b0779472232b0b8ef26e95 (diff) | |
download | gnunet-5c0b58109855f17232a0f00bf3ac613487b09015.tar.gz gnunet-5c0b58109855f17232a0f00bf3ac613487b09015.zip |
-fix leak
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/gnunet-service-xdht_neighbours.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c index 77b301fa8..50fed309b 100644 --- a/src/dht/gnunet-service-xdht_neighbours.c +++ b/src/dht/gnunet-service-xdht_neighbours.c | |||
@@ -3651,7 +3651,7 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3651 | struct GNUNET_PeerIdentity best_known_dest; | 3651 | struct GNUNET_PeerIdentity best_known_dest; |
3652 | struct GNUNET_HashCode received_intermediate_trail_id; | 3652 | struct GNUNET_HashCode received_intermediate_trail_id; |
3653 | struct GNUNET_HashCode intermediate_trail_id; | 3653 | struct GNUNET_HashCode intermediate_trail_id; |
3654 | struct GNUNET_PeerIdentity *next_hop; | 3654 | struct GNUNET_PeerIdentity next_hop; |
3655 | struct GNUNET_PeerIdentity *next_routing_hop; | 3655 | struct GNUNET_PeerIdentity *next_routing_hop; |
3656 | enum GNUNET_DHT_RouteOption options; | 3656 | enum GNUNET_DHT_RouteOption options; |
3657 | struct GNUNET_HashCode test_key; | 3657 | struct GNUNET_HashCode test_key; |
@@ -3777,8 +3777,7 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3777 | key_value = GNUNET_ntohll (key_value); | 3777 | key_value = GNUNET_ntohll (key_value); |
3778 | successor = find_local_best_known_next_hop (key_value, | 3778 | successor = find_local_best_known_next_hop (key_value, |
3779 | GDS_FINGER_TYPE_NON_PREDECESSOR); | 3779 | GDS_FINGER_TYPE_NON_PREDECESSOR); |
3780 | next_hop = GNUNET_new (struct GNUNET_PeerIdentity); | 3780 | next_hop = successor.next_hop; |
3781 | *next_hop = successor.next_hop; | ||
3782 | intermediate_trail_id = successor.trail_id; | 3781 | intermediate_trail_id = successor.trail_id; |
3783 | best_known_dest = successor.best_known_destination; | 3782 | best_known_dest = successor.best_known_destination; |
3784 | 3783 | ||
@@ -3788,7 +3787,7 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3788 | GDS_ROUTING_SRC_TO_DEST); | 3787 | GDS_ROUTING_SRC_TO_DEST); |
3789 | if (NULL != next_routing_hop) | 3788 | if (NULL != next_routing_hop) |
3790 | { | 3789 | { |
3791 | next_hop = next_routing_hop; | 3790 | next_hop = *next_routing_hop; |
3792 | intermediate_trail_id = received_intermediate_trail_id; | 3791 | intermediate_trail_id = received_intermediate_trail_id; |
3793 | best_known_dest = current_best_known_dest; | 3792 | best_known_dest = current_best_known_dest; |
3794 | } | 3793 | } |
@@ -3831,19 +3830,19 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3831 | GDS_NEIGHBOURS_send_put (&put->key, | 3830 | GDS_NEIGHBOURS_send_put (&put->key, |
3832 | ntohl (put->block_type),ntohl (put->options), | 3831 | ntohl (put->block_type),ntohl (put->options), |
3833 | ntohl (put->desired_replication_level), | 3832 | ntohl (put->desired_replication_level), |
3834 | best_known_dest, intermediate_trail_id, next_hop, | 3833 | best_known_dest, intermediate_trail_id, &next_hop, |
3835 | hop_count, putlen, pp, | 3834 | hop_count, putlen, pp, |
3836 | GNUNET_TIME_absolute_ntoh (put->expiration_time), | 3835 | GNUNET_TIME_absolute_ntoh (put->expiration_time), |
3837 | payload, payload_size); | 3836 | payload, payload_size); |
3838 | return GNUNET_OK; | 3837 | return GNUNET_OK; |
3839 | } | 3838 | } |
3840 | next_hop = &next_hop_finger->trail_list[i].trail_head->peer; | 3839 | next_hop = next_hop_finger->trail_list[i].trail_head->peer; |
3841 | GDS_NEIGHBOURS_send_put (&put->key, | 3840 | GDS_NEIGHBOURS_send_put (&put->key, |
3842 | ntohl (put->block_type),ntohl (put->options), | 3841 | ntohl (put->block_type),ntohl (put->options), |
3843 | ntohl (put->desired_replication_level), | 3842 | ntohl (put->desired_replication_level), |
3844 | best_known_dest, | 3843 | best_known_dest, |
3845 | next_hop_finger->trail_list[i].trail_id, | 3844 | next_hop_finger->trail_list[i].trail_id, |
3846 | next_hop, hop_count, putlen, pp, | 3845 | &next_hop, hop_count, putlen, pp, |
3847 | GNUNET_TIME_absolute_ntoh (put->expiration_time), | 3846 | GNUNET_TIME_absolute_ntoh (put->expiration_time), |
3848 | payload, payload_size); | 3847 | payload, payload_size); |
3849 | } | 3848 | } |
@@ -3854,7 +3853,7 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3854 | GDS_NEIGHBOURS_send_put (&put->key, | 3853 | GDS_NEIGHBOURS_send_put (&put->key, |
3855 | ntohl (put->block_type),ntohl (put->options), | 3854 | ntohl (put->block_type),ntohl (put->options), |
3856 | ntohl (put->desired_replication_level), | 3855 | ntohl (put->desired_replication_level), |
3857 | best_known_dest, intermediate_trail_id, next_hop, | 3856 | best_known_dest, intermediate_trail_id, &next_hop, |
3858 | hop_count, putlen, pp, | 3857 | hop_count, putlen, pp, |
3859 | GNUNET_TIME_absolute_ntoh (put->expiration_time), | 3858 | GNUNET_TIME_absolute_ntoh (put->expiration_time), |
3860 | payload, payload_size); | 3859 | payload, payload_size); |
@@ -3885,7 +3884,7 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3885 | struct GNUNET_HashCode intermediate_trail_id; | 3884 | struct GNUNET_HashCode intermediate_trail_id; |
3886 | struct GNUNET_HashCode received_intermediate_trail_id; | 3885 | struct GNUNET_HashCode received_intermediate_trail_id; |
3887 | struct Closest_Peer successor; | 3886 | struct Closest_Peer successor; |
3888 | struct GNUNET_PeerIdentity *next_hop; | 3887 | struct GNUNET_PeerIdentity next_hop; |
3889 | struct GNUNET_PeerIdentity *next_routing_hop; | 3888 | struct GNUNET_PeerIdentity *next_routing_hop; |
3890 | uint32_t get_length; | 3889 | uint32_t get_length; |
3891 | uint64_t key_value; | 3890 | uint64_t key_value; |
@@ -3956,8 +3955,7 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3956 | 3955 | ||
3957 | successor = find_local_best_known_next_hop (key_value, | 3956 | successor = find_local_best_known_next_hop (key_value, |
3958 | GDS_FINGER_TYPE_NON_PREDECESSOR); | 3957 | GDS_FINGER_TYPE_NON_PREDECESSOR); |
3959 | next_hop = GNUNET_new (struct GNUNET_PeerIdentity); | 3958 | next_hop = successor.next_hop; |
3960 | *next_hop = successor.next_hop; | ||
3961 | best_known_dest = successor.best_known_destination; | 3959 | best_known_dest = successor.best_known_destination; |
3962 | intermediate_trail_id = successor.trail_id; | 3960 | intermediate_trail_id = successor.trail_id; |
3963 | /* I am not the final destination. I am part of trail to reach final dest. */ | 3961 | /* I am not the final destination. I am part of trail to reach final dest. */ |
@@ -3967,7 +3965,7 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
3967 | GDS_ROUTING_SRC_TO_DEST); | 3965 | GDS_ROUTING_SRC_TO_DEST); |
3968 | if (NULL != next_routing_hop) | 3966 | if (NULL != next_routing_hop) |
3969 | { | 3967 | { |
3970 | next_hop = next_routing_hop; | 3968 | next_hop = *next_routing_hop; |
3971 | best_known_dest = current_best_known_dest; | 3969 | best_known_dest = current_best_known_dest; |
3972 | intermediate_trail_id = received_intermediate_trail_id; | 3970 | intermediate_trail_id = received_intermediate_trail_id; |
3973 | } | 3971 | } |
@@ -4006,17 +4004,17 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
4006 | { | 4004 | { |
4007 | GDS_NEIGHBOURS_send_get (&(get->key), get->block_type, get->options, | 4005 | GDS_NEIGHBOURS_send_get (&(get->key), get->block_type, get->options, |
4008 | get->desired_replication_level, best_known_dest, | 4006 | get->desired_replication_level, best_known_dest, |
4009 | intermediate_trail_id, next_hop, hop_count, | 4007 | intermediate_trail_id, &next_hop, hop_count, |
4010 | get_length, gp); | 4008 | get_length, gp); |
4011 | return GNUNET_OK; | 4009 | return GNUNET_OK; |
4012 | } | 4010 | } |
4013 | if (GNUNET_YES == next_hop_finger->trail_list[i].is_present) | 4011 | if (GNUNET_YES == next_hop_finger->trail_list[i].is_present) |
4014 | { | 4012 | { |
4015 | next_hop = &next_hop_finger->trail_list[i].trail_head->peer; | 4013 | next_hop = next_hop_finger->trail_list[i].trail_head->peer; |
4016 | GDS_NEIGHBOURS_send_get (&(get->key), get->block_type, get->options, | 4014 | GDS_NEIGHBOURS_send_get (&(get->key), get->block_type, get->options, |
4017 | get->desired_replication_level, best_known_dest, | 4015 | get->desired_replication_level, best_known_dest, |
4018 | next_hop_finger->trail_list[i].trail_id, | 4016 | next_hop_finger->trail_list[i].trail_id, |
4019 | next_hop, hop_count, | 4017 | &next_hop, hop_count, |
4020 | get_length, gp); | 4018 | get_length, gp); |
4021 | } | 4019 | } |
4022 | } | 4020 | } |
@@ -4025,7 +4023,7 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
4025 | #endif | 4023 | #endif |
4026 | GDS_NEIGHBOURS_send_get (&(get->key), get->block_type, get->options, | 4024 | GDS_NEIGHBOURS_send_get (&(get->key), get->block_type, get->options, |
4027 | get->desired_replication_level, best_known_dest, | 4025 | get->desired_replication_level, best_known_dest, |
4028 | intermediate_trail_id, next_hop, hop_count, | 4026 | intermediate_trail_id, &next_hop, hop_count, |
4029 | get_length, gp); | 4027 | get_length, gp); |
4030 | } | 4028 | } |
4031 | return GNUNET_YES; | 4029 | return GNUNET_YES; |