From abf01ed13af22637ceeb4c5732c2347fd25a8c03 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 19 Nov 2010 11:33:48 -0500 Subject: [PATCH] Avoid double-invocation of user callback with EVUTIL_EAI_CANCEL --- evdns.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/evdns.c b/evdns.c index 25857a38..e13dbbf5 100644 --- a/evdns.c +++ b/evdns.c @@ -4248,6 +4248,11 @@ evdns_getaddrinfo_gotresolve(int result, char type, int count, free_getaddrinfo_request(data); return; } else if (data->user_canceled) { + if (other_req->r) { + /* The other request is still working; let it + * hit the callback and report the failure. */ + return; + } data->user_cb(EVUTIL_EAI_CANCEL, NULL, data->user_data); free_getaddrinfo_request(data); return; -- 2.40.0