aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-01-11 14:02:59 -0500
committerNick Mathewson <nickm@torproject.org>2012-01-16 15:03:13 -0500
commitcc02823d7f6acbc3fa8ea87e5646921100796f10 (patch)
tree45d4ba4a4cc9ef73c076f08934f68d9690b9044c /src/or/connection_edge.c
parentedcc9981d8b8894d2ef4e0d617a20d7d99547817 (diff)
downloadtor-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.c5
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));