diff --git a/evdns.c b/evdns.c index d085bac8..583c253a 100644 --- a/evdns.c +++ b/evdns.c @@ -4310,7 +4310,8 @@ evdns_getaddrinfo_gotresolve(int result, char type, int count, evdns_cancel_request(NULL, other_req->r); } data->user_cb(EVUTIL_EAI_MEMORY, NULL, data->user_data); - evutil_freeaddrinfo(res); + if (res) + evutil_freeaddrinfo(res); if (other_req->r == NULL) free_getaddrinfo_request(data);