diff --git a/src/test/test_address.c b/src/test/test_address.c index 3b17b23571..748dfc5a68 100644 --- a/src/test/test_address.c +++ b/src/test/test_address.c @@ -297,7 +297,9 @@ test_address_get_if_addrs_ifaddrs(void *arg) } done: - SMARTLIST_FOREACH(results, tor_addr_t *, t, tor_free(t)); + if (results) { + SMARTLIST_FOREACH(results, tor_addr_t *, t, tor_free(t)); + } smartlist_free(results); return; }