diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-10-19 11:24:32 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-10-19 11:24:32 -0400 |
commit | f7adf3653ff313d45d70bed7c0fdcdd0d64f29ab (patch) | |
tree | d269899dad5eb89958d762b6db733cdd6fb1972a /src/feature/dirclient | |
parent | 151d446aa1df2ab67584f4aa7c04be234f18fc91 (diff) | |
download | tor-f7adf3653ff313d45d70bed7c0fdcdd0d64f29ab.tar.gz tor-f7adf3653ff313d45d70bed7c0fdcdd0d64f29ab.zip |
Simplify logic to use smartlist_add_asprintf()
Diffstat (limited to 'src/feature/dirclient')
-rw-r--r-- | src/feature/dirclient/dirclient.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/feature/dirclient/dirclient.c b/src/feature/dirclient/dirclient.c index c83c93f56d..b41ae107b3 100644 --- a/src/feature/dirclient/dirclient.c +++ b/src/feature/dirclient/dirclient.c @@ -1995,9 +1995,8 @@ dirclient_dump_total_dls(void) if (options->SafeLogging_ != SAFELOG_SCRUB_NONE && purpose_needs_anonymity(i, ROUTER_PURPOSE_GENERAL, NULL)) continue; - char *line = NULL; - tor_asprintf(&line, "%"PRIu64" (%s)", n, dir_conn_purpose_to_string(i)); - smartlist_add(lines, line); + smartlist_add_asprintf(lines, "%"PRIu64" (%s)", + n, dir_conn_purpose_to_string(i)); } if (smartlist_len(lines) > 0) { |