aboutsummaryrefslogtreecommitdiff
path: root/src/feature/relay/router.c
diff options
context:
space:
mode:
authorNeel Chauhan <neel@neelc.org>2020-07-24 18:23:50 -0700
committerNick Mathewson <nickm@torproject.org>2020-07-30 10:46:15 -0400
commit67a62ccf51f46bde75e0675b1ee19c024152f088 (patch)
treec62c1a86300dea0c1aa3767dffad04b47fc3a7bb /src/feature/relay/router.c
parentc212578bf05138801597dcce23f52780c9b7dbb3 (diff)
downloadtor-67a62ccf51f46bde75e0675b1ee19c024152f088.tar.gz
tor-67a62ccf51f46bde75e0675b1ee19c024152f088.zip
Use write_str_if_not_equal() for onion services
Diffstat (limited to 'src/feature/relay/router.c')
-rw-r--r--src/feature/relay/router.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c
index 25263468c8..675b977ade 100644
--- a/src/feature/relay/router.c
+++ b/src/feature/relay/router.c
@@ -835,7 +835,7 @@ router_initialize_tls_context(void)
STATIC int
router_write_fingerprint(int hashed, int ed25519_identity)
{
- char *keydir = NULL, *cp = NULL;
+ char *keydir = NULL;
const char *fname = hashed ? "hashed-fingerprint" :
(ed25519_identity ? "fingerprint-ed25519" :
"fingerprint");
@@ -870,7 +870,7 @@ router_write_fingerprint(int hashed, int ed25519_identity)
tor_asprintf(&fingerprint_line, "%s %s\n", options->Nickname, fingerprint);
/* Check whether we need to write the (hashed-)fingerprint file. */
- if (write_str_if_not_equal(keydir, fingerprint_line)) {
+ if (write_str_to_file_if_not_equal(keydir, fingerprint_line)) {
log_err(LD_FS, "Error writing %s%s line to file",
hashed ? "hashed " : "",
ed25519_identity ? "ed25519 identity" : "fingerprint");
@@ -884,7 +884,6 @@ router_write_fingerprint(int hashed, int ed25519_identity)
result = 0;
done:
- tor_free(cp);
tor_free(keydir);
tor_free(fingerprint_line);
return result;