diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-01-11 14:02:59 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-01-16 15:03:13 -0500 |
commit | cc02823d7f6acbc3fa8ea87e5646921100796f10 (patch) | |
tree | 45d4ba4a4cc9ef73c076f08934f68d9690b9044c /src/or/connection_edge.c | |
parent | edcc9981d8b8894d2ef4e0d617a20d7d99547817 (diff) | |
download | tor-cc02823d7f6acbc3fa8ea87e5646921100796f10.tar.gz tor-cc02823d7f6acbc3fa8ea87e5646921100796f10.zip |
Convert instances of tor_snprintf+strdup into tor_asprintf
These were found by looking for tor_snprintf() instances that were
followed closely by tor_strdup(), though I probably converted some
other snprintfs as well.
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r-- | src/or/connection_edge.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index aba9ba2727..7de627d729 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -1165,11 +1165,10 @@ addressmap_rewrite(char *address, size_t maxlen, time_t *expires_out) static int addressmap_rewrite_reverse(char *address, size_t maxlen, time_t *expires_out) { - size_t len = maxlen + 16; - char *s = tor_malloc(len), *cp; + char *s, *cp; addressmap_entry_t *ent; int r = 0; - tor_snprintf(s, len, "REVERSE[%s]", address); + tor_asprintf(&s, "REVERSE[%s]", address); ent = strmap_get(addressmap, s); if (ent) { cp = tor_strdup(escaped_safe_str_client(ent->new_address)); |