diff options
Diffstat (limited to 'src/common/address.c')
-rw-r--r-- | src/common/address.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/common/address.c b/src/common/address.c index f40e428cce..ab056f427e 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -962,8 +962,11 @@ char * tor_dup_addr(const tor_addr_t *addr) { char buf[TOR_ADDR_BUF_LEN]; - tor_addr_to_str(buf, addr, sizeof(buf), 0); - return tor_strdup(buf); + if (tor_addr_to_str(buf, addr, sizeof(buf), 0)) { + return tor_strdup(buf); + } else { + return tor_strdup("<unknown address type>"); + } } /** Return a string representing the address <b>addr</b>. This string is |