aboutsummaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/tor-resolve.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c
index ba83f3e3b4..803ed26b3b 100644
--- a/src/tools/tor-resolve.c
+++ b/src/tools/tor-resolve.c
@@ -512,14 +512,7 @@ do_resolve(const char *hostname,
domainname_t *dn =
socks5_server_reply_get_bind_addr_domainname(reply);
- size_t result_len = (size_t)domainname_get_len(dn);
-
- *result_hostname = tor_malloc(result_len+1);
-
- strncpy(*result_hostname, (char *)domainname_getstr_name(dn),
- result_len);
-
- (*result_hostname)[result_len] = '\0';
+ *result_hostname = tor_strdup(domainname_getstr_name(dn));
}
socks5_server_reply_free(reply);