From 3417f6808d4c86b02148cde4f7a32b18d8d260b4 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 13 Apr 2011 11:20:30 -0400 Subject: [PATCH] Avoid a free(NULL) if out-of-memory in evdns_getaddrinfo. Found by Dave Hart --- evdns.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.40.0