Avoid a memory-leak on OOM in evdns.

This commit is contained in:
George Danchev 2012-09-12 20:11:12 -04:00 committed by Nick Mathewson
parent 484e93c1d0
commit 73e85dd08f

View File

@ -2291,7 +2291,10 @@ nameserver_send_probe(struct nameserver *const ns) {
handle = mm_calloc(1, sizeof(*handle));
if (!handle) return;
req = request_new(ns->base, handle, TYPE_A, "google.com", DNS_QUERY_NO_SEARCH, nameserver_probe_callback, ns);
if (!req) return;
if (!req) {
mm_free(handle);
return;
}
ns->probe_request = handle;
/* we force this into the inflight queue no matter what */
request_trans_id_set(req, transaction_id_pick(ns->base));