diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-07-28 10:22:10 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-07-28 10:22:10 -0400 |
commit | 9fe6fea1cceb39fc415ad813020bbd863121e0c9 (patch) | |
tree | 0437c4df402c6b7128d67e8c34d981bdd656b400 /src/or | |
parent | 0390e1a60cb91fa581ec568879bf300224db6322 (diff) | |
download | tor-9fe6fea1cceb39fc415ad813020bbd863121e0c9.tar.gz tor-9fe6fea1cceb39fc415ad813020bbd863121e0c9.zip |
Fix a huge pile of -Wshadow warnings.
These appeared on some of the Jenkins platforms. Apparently some
GCCs care when you shadow globals, and some don't.
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/addressmap.c | 24 | ||||
-rw-r--r-- | src/or/circuitbuild.c | 42 | ||||
-rw-r--r-- | src/or/circuitstats.c | 10 | ||||
-rw-r--r-- | src/or/config.c | 12 | ||||
-rw-r--r-- | src/or/connection_edge.c | 16 | ||||
-rw-r--r-- | src/or/control.c | 6 | ||||
-rw-r--r-- | src/or/dirvote.c | 3 | ||||
-rw-r--r-- | src/or/policies.c | 8 | ||||
-rw-r--r-- | src/or/relay.c | 8 | ||||
-rw-r--r-- | src/or/rendclient.c | 6 | ||||
-rw-r--r-- | src/or/rephist.c | 19 | ||||
-rw-r--r-- | src/or/routerkeys.c | 12 | ||||
-rw-r--r-- | src/or/shared_random.c | 10 |
13 files changed, 88 insertions, 88 deletions
diff --git a/src/or/addressmap.c b/src/or/addressmap.c index 047a863ef5..f7544abacc 100644 --- a/src/or/addressmap.c +++ b/src/or/addressmap.c @@ -264,18 +264,18 @@ addressmap_clear_invalid_automaps(const or_options_t *options) clear_all = 1; /* This should be impossible, but let's be sure. */ STRMAP_FOREACH_MODIFY(addressmap, src_address, addressmap_entry_t *, ent) { - int remove = clear_all; + int remove_this = clear_all; if (ent->source != ADDRMAPSRC_AUTOMAP) continue; /* not an automap mapping. */ - if (!remove) { - remove = ! addressmap_address_should_automap(src_address, options); + if (!remove_this) { + remove_this = ! addressmap_address_should_automap(src_address, options); } - if (!remove && ! address_is_in_virtual_range(ent->new_address)) - remove = 1; + if (!remove_this && ! address_is_in_virtual_range(ent->new_address)) + remove_this = 1; - if (remove) { + if (remove_this) { addressmap_ent_remove(src_address, ent); MAP_DEL_CURRENT(src_address); } @@ -896,10 +896,10 @@ addressmap_get_virtual_address(int type) tor_assert(addressmap); if (type == RESOLVED_TYPE_HOSTNAME) { - char rand[10]; + char rand_bytes[10]; do { - crypto_rand(rand, sizeof(rand)); - base32_encode(buf,sizeof(buf),rand,sizeof(rand)); + crypto_rand(rand_bytes, sizeof(rand_bytes)); + base32_encode(buf,sizeof(buf),rand_bytes,sizeof(rand_bytes)); strlcat(buf, ".virtual", sizeof(buf)); } while (strmap_get(addressmap, buf)); return tor_strdup(buf); @@ -1107,11 +1107,11 @@ addressmap_get_mappings(smartlist_t *sl, time_t min_expires, smartlist_add_asprintf(sl, "%s%s %s%s NEVER", src_wc, key, dst_wc, val->new_address); else { - char time[ISO_TIME_LEN+1]; - format_iso_time(time, val->expires); + char isotime[ISO_TIME_LEN+1]; + format_iso_time(isotime, val->expires); smartlist_add_asprintf(sl, "%s%s %s%s \"%s\"", src_wc, key, dst_wc, val->new_address, - time); + isotime); } } else { smartlist_add_asprintf(sl, "%s%s %s%s", diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index dab378f0e8..f3eab917a9 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -457,14 +457,14 @@ origin_circuit_init(uint8_t purpose, int flags) * it's not open already. */ origin_circuit_t * -circuit_establish_circuit(uint8_t purpose, extend_info_t *exit, int flags) +circuit_establish_circuit(uint8_t purpose, extend_info_t *exit_ei, int flags) { origin_circuit_t *circ; int err_reason = 0; circ = origin_circuit_init(purpose, flags); - if (onion_pick_cpath_exit(circ, exit) < 0 || + if (onion_pick_cpath_exit(circ, exit_ei) < 0 || onion_populate_cpath(circ) < 0) { circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_NOPATH); return NULL; @@ -1433,7 +1433,7 @@ onionskin_answer(or_circuit_t *circ, * to handle the desired path length, return -1. */ static int -new_route_len(uint8_t purpose, extend_info_t *exit, smartlist_t *nodes) +new_route_len(uint8_t purpose, extend_info_t *exit_ei, smartlist_t *nodes) { int num_acceptable_routers; int routelen; @@ -1441,7 +1441,7 @@ new_route_len(uint8_t purpose, extend_info_t *exit, smartlist_t *nodes) tor_assert(nodes); routelen = DEFAULT_ROUTE_LEN; - if (exit && + if (exit_ei && purpose != CIRCUIT_PURPOSE_TESTING && purpose != CIRCUIT_PURPOSE_S_ESTABLISH_INTRO) routelen++; @@ -1957,7 +1957,7 @@ warn_if_last_router_excluded(origin_circuit_t *circ, const extend_info_t *exit) * router (or use <b>exit</b> if provided). Store these in the * cpath. Return 0 if ok, -1 if circuit should be closed. */ static int -onion_pick_cpath_exit(origin_circuit_t *circ, extend_info_t *exit) +onion_pick_cpath_exit(origin_circuit_t *circ, extend_info_t *exit_ei) { cpath_build_state_t *state = circ->build_state; @@ -1965,17 +1965,17 @@ onion_pick_cpath_exit(origin_circuit_t *circ, extend_info_t *exit) log_debug(LD_CIRC, "Launching a one-hop circuit for dir tunnel."); state->desired_path_len = 1; } else { - int r = new_route_len(circ->base_.purpose, exit, nodelist_get_list()); + int r = new_route_len(circ->base_.purpose, exit_ei, nodelist_get_list()); if (r < 1) /* must be at least 1 */ return -1; state->desired_path_len = r; } - if (exit) { /* the circuit-builder pre-requested one */ - warn_if_last_router_excluded(circ, exit); + if (exit_ei) { /* the circuit-builder pre-requested one */ + warn_if_last_router_excluded(circ, exit_ei); log_info(LD_CIRC,"Using requested exit node '%s'", - extend_info_describe(exit)); - exit = extend_info_dup(exit); + extend_info_describe(exit_ei)); + exit_ei = extend_info_dup(exit_ei); } else { /* we have to decide one */ const node_t *node = choose_good_exit_server(circ->base_.purpose, state->need_uptime, @@ -1984,10 +1984,10 @@ onion_pick_cpath_exit(origin_circuit_t *circ, extend_info_t *exit) log_warn(LD_CIRC,"Failed to choose an exit server"); return -1; } - exit = extend_info_from_node(node, 0); - tor_assert(exit); + exit_ei = extend_info_from_node(node, 0); + tor_assert(exit_ei); } - state->chosen_exit = exit; + state->chosen_exit = exit_ei; return 0; } @@ -1996,19 +1996,19 @@ onion_pick_cpath_exit(origin_circuit_t *circ, extend_info_t *exit) * the caller will do this if it wants to. */ int -circuit_append_new_exit(origin_circuit_t *circ, extend_info_t *exit) +circuit_append_new_exit(origin_circuit_t *circ, extend_info_t *exit_ei) { cpath_build_state_t *state; - tor_assert(exit); + tor_assert(exit_ei); tor_assert(circ); state = circ->build_state; tor_assert(state); extend_info_free(state->chosen_exit); - state->chosen_exit = extend_info_dup(exit); + state->chosen_exit = extend_info_dup(exit_ei); ++circ->build_state->desired_path_len; - onion_append_hop(&circ->cpath, exit); + onion_append_hop(&circ->cpath, exit_ei); return 0; } @@ -2017,18 +2017,18 @@ circuit_append_new_exit(origin_circuit_t *circ, extend_info_t *exit) * send the next extend cell to begin connecting to that hop. */ int -circuit_extend_to_new_exit(origin_circuit_t *circ, extend_info_t *exit) +circuit_extend_to_new_exit(origin_circuit_t *circ, extend_info_t *exit_ei) { int err_reason = 0; - warn_if_last_router_excluded(circ, exit); + warn_if_last_router_excluded(circ, exit_ei); tor_gettimeofday(&circ->base_.timestamp_began); - circuit_append_new_exit(circ, exit); + circuit_append_new_exit(circ, exit_ei); circuit_set_state(TO_CIRCUIT(circ), CIRCUIT_STATE_BUILDING); if ((err_reason = circuit_send_next_onion_skin(circ))<0) { log_warn(LD_CIRC, "Couldn't extend circuit to new point %s.", - extend_info_describe(exit)); + extend_info_describe(exit_ei)); circuit_mark_for_close(TO_CIRCUIT(circ), -err_reason); return -1; } diff --git a/src/or/circuitstats.c b/src/or/circuitstats.c index 9ac2d565b5..f4db64ebca 100644 --- a/src/or/circuitstats.c +++ b/src/or/circuitstats.c @@ -578,18 +578,18 @@ circuit_build_times_rewind_history(circuit_build_times_t *cbt, int n) * array is full. */ int -circuit_build_times_add_time(circuit_build_times_t *cbt, build_time_t time) +circuit_build_times_add_time(circuit_build_times_t *cbt, build_time_t btime) { - if (time <= 0 || time > CBT_BUILD_TIME_MAX) { + if (btime <= 0 || btime > CBT_BUILD_TIME_MAX) { log_warn(LD_BUG, "Circuit build time is too large (%u)." - "This is probably a bug.", time); + "This is probably a bug.", btime); tor_fragile_assert(); return -1; } - log_debug(LD_CIRC, "Adding circuit build time %u", time); + log_debug(LD_CIRC, "Adding circuit build time %u", btime); - cbt->circuit_build_times[cbt->build_times_idx] = time; + cbt->circuit_build_times[cbt->build_times_idx] = btime; cbt->build_times_idx = (cbt->build_times_idx + 1) % CBT_NCIRCUITS_TO_OBSERVE; if (cbt->total_build_times < CBT_NCIRCUITS_TO_OBSERVE) cbt->total_build_times++; diff --git a/src/or/config.c b/src/or/config.c index fb2ab5ae1b..64c9796792 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -5073,7 +5073,7 @@ options_init_logs(const or_options_t *old_options, or_options_t *options, config_line_t *opt; int ok; smartlist_t *elts; - int daemon = + int run_as_daemon = #ifdef _WIN32 0; #else @@ -5134,7 +5134,7 @@ options_init_logs(const or_options_t *old_options, or_options_t *options, int err = smartlist_len(elts) && !strcasecmp(smartlist_get(elts,0), "stderr"); if (!validate_only) { - if (daemon) { + if (run_as_daemon) { log_warn(LD_CONFIG, "Can't log to %s with RunAsDaemon set; skipping stdout", err?"stderr":"stdout"); @@ -5163,19 +5163,19 @@ options_init_logs(const or_options_t *old_options, or_options_t *options, char *fname = expand_filename(smartlist_get(elts, 1)); /* Truncate if TruncateLogFile is set and we haven't seen this option line before. */ - int truncate = 0; + int truncate_log = 0; if (options->TruncateLogFile) { - truncate = 1; + truncate_log = 1; if (old_options) { config_line_t *opt2; for (opt2 = old_options->Logs; opt2; opt2 = opt2->next) if (!strcmp(opt->value, opt2->value)) { - truncate = 0; + truncate_log = 0; break; } } } - if (add_file_log(severity, fname, truncate) < 0) { + if (add_file_log(severity, fname, truncate_log) < 0) { log_warn(LD_CONFIG, "Couldn't open file for 'Log %s': %s", opt->value, strerror(errno)); ok = 0; diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index cb79de65d9..0ef5310134 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -3333,19 +3333,20 @@ connection_edge_is_rendezvous_stream(edge_connection_t *conn) return 0; } -/** Return 1 if router <b>exit</b> is likely to allow stream <b>conn</b> +/** Return 1 if router <b>exit_node</b> is likely to allow stream <b>conn</b> * to exit from it, or 0 if it probably will not allow it. * (We might be uncertain if conn's destination address has not yet been * resolved.) */ int -connection_ap_can_use_exit(const entry_connection_t *conn, const node_t *exit) +connection_ap_can_use_exit(const entry_connection_t *conn, + const node_t *exit_node) { const or_options_t *options = get_options(); tor_assert(conn); tor_assert(conn->socks_request); - tor_assert(exit); + tor_assert(exit_node); /* If a particular exit node has been requested for the new connection, * make sure the exit node of the existing circuit matches exactly. @@ -3354,7 +3355,7 @@ connection_ap_can_use_exit(const entry_connection_t *conn, const node_t *exit) const node_t *chosen_exit = node_get_by_nickname(conn->chosen_exit_name, 1); if (!chosen_exit || tor_memneq(chosen_exit->identity, - exit->identity, DIGEST_LEN)) { + exit_node->identity, DIGEST_LEN)) { /* doesn't match */ // log_debug(LD_APP,"Requested node '%s', considering node '%s'. No.", // conn->chosen_exit_name, exit->nickname); @@ -3379,7 +3380,8 @@ connection_ap_can_use_exit(const entry_connection_t *conn, const node_t *exit) tor_addr_make_null(&addr, AF_INET); addrp = &addr; } - r = compare_tor_addr_to_node_policy(addrp, conn->socks_request->port,exit); + r = compare_tor_addr_to_node_policy(addrp, conn->socks_request->port, + exit_node); if (r == ADDR_POLICY_REJECTED) return 0; /* We know the address, and the exit policy rejects it. */ if (r == ADDR_POLICY_PROBABLY_REJECTED && !conn->chosen_exit_name) @@ -3388,10 +3390,10 @@ connection_ap_can_use_exit(const entry_connection_t *conn, const node_t *exit) * this node, err on the side of caution. */ } else if (SOCKS_COMMAND_IS_RESOLVE(conn->socks_request->command)) { /* Don't send DNS requests to non-exit servers by default. */ - if (!conn->chosen_exit_name && node_exit_policy_rejects_all(exit)) + if (!conn->chosen_exit_name && node_exit_policy_rejects_all(exit_node)) return 0; } - if (routerset_contains_node(options->ExcludeExitNodesUnion_, exit)) { + if (routerset_contains_node(options->ExcludeExitNodesUnion_, exit_node)) { /* Not a suitable exit. Refuse it. */ return 0; } diff --git a/src/or/control.c b/src/or/control.c index 0c4bcbd31c..ec76ecfca9 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -6084,14 +6084,14 @@ control_event_buildtimeout_set(buildtimeout_set_event_t type, /** Called when a signal has been processed from signal_callback */ int -control_event_signal(uintptr_t signal) +control_event_signal(uintptr_t signal_num) { const char *signal_string = NULL; if (!control_event_is_interesting(EVENT_GOT_SIGNAL)) return 0; - switch (signal) { + switch (signal_num) { case SIGHUP: signal_string = "RELOAD"; break; @@ -6112,7 +6112,7 @@ control_event_signal(uintptr_t signal) break; default: log_warn(LD_BUG, "Unrecognized signal %lu in control_event_signal", - (unsigned long)signal); + (unsigned long)signal_num); return -1; } diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 2db8731f48..94a13e365d 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -1431,7 +1431,6 @@ networkstatus_compute_consensus(smartlist_t *votes, /* Add the actual router entries. */ { - int *index; /* index[j] is the current index into votes[j]. */ int *size; /* size[j] is the number of routerstatuses in votes[j]. */ int *flag_counts; /* The number of voters that list flag[j] for the * currently considered router. */ @@ -1466,7 +1465,6 @@ networkstatus_compute_consensus(smartlist_t *votes, memset(conflict, 0, sizeof(conflict)); memset(unknown, 0xff, sizeof(conflict)); - index = tor_calloc(smartlist_len(votes), sizeof(int)); size = tor_calloc(smartlist_len(votes), sizeof(int)); n_voter_flags = tor_calloc(smartlist_len(votes), sizeof(int)); n_flag_voters = tor_calloc(smartlist_len(flags), sizeof(int)); @@ -1932,7 +1930,6 @@ networkstatus_compute_consensus(smartlist_t *votes, /* And the loop is over and we move on to the next router */ } - tor_free(index); tor_free(size); tor_free(n_voter_flags); tor_free(n_flag_voters); diff --git a/src/or/policies.c b/src/or/policies.c index 0b8f3351fb..07f256f5cc 100644 --- a/src/or/policies.c +++ b/src/or/policies.c @@ -2669,7 +2669,7 @@ compare_tor_addr_to_short_policy(const tor_addr_t *addr, uint16_t port, { int i; int found_match = 0; - int accept; + int accept_; tor_assert(port != 0); @@ -2689,9 +2689,9 @@ compare_tor_addr_to_short_policy(const tor_addr_t *addr, uint16_t port, } if (found_match) - accept = policy->is_accept; + accept_ = policy->is_accept; else - accept = ! policy->is_accept; + accept_ = ! policy->is_accept; /* ???? are these right? -NM */ /* We should be sure not to return ADDR_POLICY_ACCEPTED in the accept @@ -2704,7 +2704,7 @@ compare_tor_addr_to_short_policy(const tor_addr_t *addr, uint16_t port, * * Once microdescriptors can handle addresses in special cases (e.g. if * we ever solve ticket 1774), we can provide certainty here. -RD */ - if (accept) + if (accept_) return ADDR_POLICY_PROBABLY_ACCEPTED; else return ADDR_POLICY_REJECTED; diff --git a/src/or/relay.c b/src/or/relay.c index 51b33cc92c..309bb403f4 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -255,12 +255,12 @@ circuit_receive_relay_cell(cell_t *cell, circuit_t *circ, if (! CIRCUIT_IS_ORIGIN(circ) && TO_OR_CIRCUIT(circ)->rend_splice && cell_direction == CELL_DIRECTION_OUT) { - or_circuit_t *splice = TO_OR_CIRCUIT(circ)->rend_splice; + or_circuit_t *splice_ = TO_OR_CIRCUIT(circ)->rend_splice; tor_assert(circ->purpose == CIRCUIT_PURPOSE_REND_ESTABLISHED); - tor_assert(splice->base_.purpose == CIRCUIT_PURPOSE_REND_ESTABLISHED); - cell->circ_id = splice->p_circ_id; + tor_assert(splice_->base_.purpose == CIRCUIT_PURPOSE_REND_ESTABLISHED); + cell->circ_id = splice_->p_circ_id; cell->command = CELL_RELAY; /* can't be relay_early anyway */ - if ((reason = circuit_receive_relay_cell(cell, TO_CIRCUIT(splice), + if ((reason = circuit_receive_relay_cell(cell, TO_CIRCUIT(splice_), CELL_DIRECTION_IN)) < 0) { log_warn(LD_REND, "Error relaying cell across rendezvous; closing " "circuits"); diff --git a/src/or/rendclient.c b/src/or/rendclient.c index 2d47e12e08..3468b07561 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -830,9 +830,9 @@ fetch_v2_desc_by_addr(rend_data_t *query, smartlist_t *hsdirs) tries_left = REND_NUMBER_OF_NON_CONSECUTIVE_REPLICAS; while (tries_left > 0) { - int rand = crypto_rand_int(tries_left); - int chosen_replica = replicas_left_to_try[rand]; - replicas_left_to_try[rand] = replicas_left_to_try[--tries_left]; + int rand_val = crypto_rand_int(tries_left); + int chosen_replica = replicas_left_to_try[rand_val]; + replicas_left_to_try[rand_val] = replicas_left_to_try[--tries_left]; ret = rend_compute_v2_desc_id(descriptor_id, query->onion_address, query->auth_type == REND_STEALTH_AUTH ? diff --git a/src/or/rephist.c b/src/or/rephist.c index 929e95d86c..0eab5e099f 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -743,14 +743,15 @@ rep_history_clean(time_t before) orhist_it = digestmap_iter_init(history_map); while (!digestmap_iter_done(orhist_it)) { - int remove; + int should_remove; digestmap_iter_get(orhist_it, &d1, &or_history_p); or_history = or_history_p; - remove = authority ? (or_history->total_run_weights < STABILITY_EPSILON && + should_remove = authority ? + (or_history->total_run_weights < STABILITY_EPSILON && !or_history->start_of_run) : (or_history->changed < before); - if (remove) { + if (should_remove) { orhist_it = digestmap_iter_next_rmv(history_map, orhist_it); free_or_history(or_history); continue; @@ -2294,16 +2295,16 @@ void rep_hist_add_buffer_stats(double mean_num_cells_in_queue, double mean_time_cells_in_queue, uint32_t processed_cells) { - circ_buffer_stats_t *stat; + circ_buffer_stats_t *stats; if (!start_of_buffer_stats_interval) return; /* Not initialized. */ - stat = tor_malloc_zero(sizeof(circ_buffer_stats_t)); - stat->mean_num_cells_in_queue = mean_num_cells_in_queue; - stat->mean_time_cells_in_queue = mean_time_cells_in_queue; - stat->processed_cells = processed_cells; + stats = tor_malloc_zero(sizeof(circ_buffer_stats_t)); + stats->mean_num_cells_in_queue = mean_num_cells_in_queue; + stats->mean_time_cells_in_queue = mean_time_cells_in_queue; + stats->processed_cells = processed_cells; if (!circuits_for_buffer_stats) circuits_for_buffer_stats = smartlist_new(); - smartlist_add(circuits_for_buffer_stats, stat); + smartlist_add(circuits_for_buffer_stats, stats); } /** Remember cell statistics for circuit <b>circ</b> at time diff --git a/src/or/routerkeys.c b/src/or/routerkeys.c index 27a19f5113..060ffd8753 100644 --- a/src/or/routerkeys.c +++ b/src/or/routerkeys.c @@ -931,15 +931,15 @@ load_ed_keys(const or_options_t *options, time_t now) int generate_ed_link_cert(const or_options_t *options, time_t now) { - const tor_x509_cert_t *link = NULL, *id = NULL; + const tor_x509_cert_t *link_ = NULL, *id = NULL; tor_cert_t *link_cert = NULL; - if (tor_tls_get_my_certs(1, &link, &id) < 0 || link == NULL) { + if (tor_tls_get_my_certs(1, &link_, &id) < 0 || link_ == NULL) { log_warn(LD_OR, "Can't get my x509 link cert."); return -1; } - const common_digests_t *digests = tor_x509_cert_get_cert_digests(link); + const common_digests_t *digests = tor_x509_cert_get_cert_digests(link_); if (link_cert_cert && ! EXPIRES_SOON(link_cert_cert, options->TestingLinkKeySlop) && @@ -979,12 +979,12 @@ should_make_new_ed_keys(const or_options_t *options, const time_t now) EXPIRES_SOON(link_cert_cert, options->TestingLinkKeySlop)) return 1; - const tor_x509_cert_t *link = NULL, *id = NULL; + const tor_x509_cert_t *link_ = NULL, *id = NULL; - if (tor_tls_get_my_certs(1, &link, &id) < 0 || link == NULL) + if (tor_tls_get_my_certs(1, &link_, &id) < 0 || link_ == NULL) return 1; - const common_digests_t *digests = tor_x509_cert_get_cert_digests(link); + const common_digests_t *digests = tor_x509_cert_get_cert_digests(link_); if (!fast_memeq(digests->d[DIGEST_SHA256], link_cert_cert->signed_key.pubkey, diff --git a/src/or/shared_random.c b/src/or/shared_random.c index c9886d92b0..0a1f24a974 100644 --- a/src/or/shared_random.c +++ b/src/or/shared_random.c @@ -115,16 +115,16 @@ static int32_t num_srv_agreements_from_vote; STATIC sr_srv_t * srv_dup(const sr_srv_t *orig) { - sr_srv_t *dup = NULL; + sr_srv_t *duplicate = NULL; if (!orig) { return NULL; } - dup = tor_malloc_zero(sizeof(sr_srv_t)); - dup->num_reveals = orig->num_reveals; - memcpy(dup->value, orig->value, sizeof(dup->value)); - return dup; + duplicate = tor_malloc_zero(sizeof(sr_srv_t)); + duplicate->num_reveals = orig->num_reveals; + memcpy(duplicate->value, orig->value, sizeof(duplicate->value)); + return duplicate; } /* Allocate a new commit object and initializing it with <b>rsa_identity</b> |