mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 20:07:56 -04:00
Avoid a memory-leak on OOM in evdns.
This commit is contained in:
parent
484e93c1d0
commit
73e85dd08f
5
evdns.c
5
evdns.c
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user