diff options
Diffstat (limited to 'src/rps/gnunet-service-rps.c')
-rw-r--r-- | src/rps/gnunet-service-rps.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index 83e06c2eb..7ad916840 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c | |||
@@ -1091,8 +1091,10 @@ add_peer_array_to_set (const struct GNUNET_PeerIdentity *peer_array, | |||
1091 | { | 1091 | { |
1092 | unsigned int i; | 1092 | unsigned int i; |
1093 | if (NULL == peer_map) | 1093 | if (NULL == peer_map) |
1094 | peer_map = GNUNET_CONTAINER_multipeermap_create (num_peers + 1, | 1094 | LOG (GNUNET_ERROR_TYPE_WARNING, |
1095 | GNUNET_NO); | 1095 | "Trying to add peers to an empty peermap.\n"); |
1096 | return; | ||
1097 | |||
1096 | for (i = 0 ; i < num_peers ; i++) | 1098 | for (i = 0 ; i < num_peers ; i++) |
1097 | { | 1099 | { |
1098 | GNUNET_CONTAINER_multipeermap_put (peer_map, | 1100 | GNUNET_CONTAINER_multipeermap_put (peer_map, |
@@ -1461,6 +1463,10 @@ handle_peer_push (void *cls, | |||
1461 | { /* We attack one single well-known peer - simply ignore */ | 1463 | { /* We attack one single well-known peer - simply ignore */ |
1462 | return GNUNET_OK; | 1464 | return GNUNET_OK; |
1463 | } | 1465 | } |
1466 | else | ||
1467 | { | ||
1468 | GNUNET_free (tmp_att_peer); | ||
1469 | } | ||
1464 | 1470 | ||
1465 | #endif /* ENABLE_MALICIOUS */ | 1471 | #endif /* ENABLE_MALICIOUS */ |
1466 | 1472 | ||
@@ -1951,6 +1957,7 @@ do_mal_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1951 | } | 1957 | } |
1952 | 1958 | ||
1953 | /* Send PULLs to some peers to learn about additional peers to attack */ | 1959 | /* Send PULLs to some peers to learn about additional peers to attack */ |
1960 | tmp_att_peer = att_peer_index; | ||
1954 | for (i = 0 ; i < num_pushes * alpha ; i++) | 1961 | for (i = 0 ; i < num_pushes * alpha ; i++) |
1955 | { | 1962 | { |
1956 | if (att_peers_tail == tmp_att_peer) | 1963 | if (att_peers_tail == tmp_att_peer) |
@@ -2597,7 +2604,11 @@ run (void *cls, | |||
2597 | gossip_list_size = 0; | 2604 | gossip_list_size = 0; |
2598 | 2605 | ||
2599 | /* file_name_view_log */ | 2606 | /* file_name_view_log */ |
2600 | GNUNET_DISK_directory_create ("/tmp/rps/"); | 2607 | if (GNUNET_OK != GNUNET_DISK_directory_create ("/tmp/rps/")) |
2608 | { | ||
2609 | LOG (GNUNET_ERROR_TYPE_WARNING, | ||
2610 | "Failed to create directory /tmp/rps/\n"); | ||
2611 | } | ||
2601 | 2612 | ||
2602 | size = (14 + strlen (GNUNET_i2s_full (&own_identity)) + 1) * sizeof (char); | 2613 | size = (14 + strlen (GNUNET_i2s_full (&own_identity)) + 1) * sizeof (char); |
2603 | file_name_view_log = GNUNET_malloc (size); | 2614 | file_name_view_log = GNUNET_malloc (size); |