diff options
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/or/router.c b/src/or/router.c index 7d9d2724f7..f8aa1e3b05 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -1973,11 +1973,8 @@ router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router, format_iso_time(published, router->cache_info.published_on); if (router->declared_family && smartlist_len(router->declared_family)) { - size_t n; - char *family = smartlist_join_strings(router->declared_family, " ", 0, &n); - n += strlen("family ") + 2; /* 1 for \n, 1 for \0. */ - family_line = tor_malloc(n); - tor_snprintf(family_line, n, "family %s\n", family); + char *family = smartlist_join_strings(router->declared_family, " ", 0, NULL); + tor_asprintf(&family_line, "family %s\n", family); tor_free(family); } else { family_line = tor_strdup(""); |