Fix null pointer dereferences in udp_ready()

The query pointer was detached too early leading to null pointer
reference.  Move the query_detach() after the query->canceled check.
This commit is contained in:
Ondřej Surý
2022-03-06 10:16:29 +01:00
parent 51147fa567
commit 9d8e8a4fcc

View File

@@ -2900,10 +2900,10 @@ udp_ready(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
dig_lookup_t *l = query->lookup;
debug("in cancel handler");
query_detach(&query);
if (!query->canceled) {
cancel_lookup(l);
}
query_detach(&query);
lookup_detach(&l);
return;
} else if (eresult != ISC_R_SUCCESS) {