summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/resolve.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/resolve.c b/src/resolve.c
index 9bdfa1c..bfd2a59 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -104,7 +104,9 @@ static void * resolve_peer(void *varg) {
fastd_async_enqueue(ASYNC_TYPE_RESOLVE_RETURN, ret, sizeof(fastd_async_resolve_return_t) + n_addr*sizeof(fastd_peer_address_t));
- freeaddrinfo(res);
+ if (res)
+ freeaddrinfo(res);
+
free(arg->hostname);
free(arg);