tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 244c60c90c7203de0fd0244fcb0345bd20640aa9
parent d9af80083baaa59b78cdabd0f385e415325407bc
Author: Roger Dingledine <arma@torproject.org>
Date:   Wed, 11 Feb 2026 16:16:42 -0500

defensive NULL assignments

should not matter, because tor_asprintf makes a new string, but this
way it's clearer that it doesn't matter.

Diffstat:
Msrc/feature/dirauth/dirvote.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/feature/dirauth/dirvote.c b/src/feature/dirauth/dirvote.c @@ -2383,7 +2383,7 @@ networkstatus_compute_consensus(smartlist_t *votes, * module. */ { char *unsigned_consensus = smartlist_join_strings(chunks, "", 0, NULL); - char *filename; + char *filename = NULL; tor_asprintf(&filename, "my-consensus-%s", flavor_name); char *fpath = get_datadir_fname(filename); write_str_to_file(fpath, unsigned_consensus, 0); @@ -3579,7 +3579,7 @@ dirvote_compute_consensuses(void) static void export_consensus_for_transparency(const char *flavor_name) { - char *filename; + char *filename = NULL; tor_asprintf(&filename, "my-consensus-%s", flavor_name); char *fpath_from = get_datadir_fname(filename); tor_free(filename);