dns_server: Don't call tevent_req_finish twice
authorVolker Lendecke <vl@samba.org>
Fri, 7 Aug 2015 05:58:20 +0000 (07:58 +0200)
committerRalph Böhme <slow@samba.org>
Fri, 7 Aug 2015 07:52:13 +0000 (09:52 +0200)
Both tevent_req_werror and tevent_req_done call tevent_req_finish on a request.
This should not be done. We should only call either of both.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source4/dns_server/dns_query.c

index 94f5d49ec2116802557f607a27b4aad64402adf5..5ddfb0ac3cec0045d9171f3f2d710a7fc30fbbd4 100644 (file)
@@ -673,11 +673,15 @@ struct tevent_req *dns_server_process_query_send(
                err = handle_question(dns, state, &in->questions[0],
                                      &state->answers, &state->ancount,
                                      &state->nsrecs, &state->nscount);
+
+               if (W_ERROR_EQUAL(err, DNS_ERR(NAME_ERROR))) {
+                       err = WERR_OK;
+               }
+
                if (tevent_req_werror(req, err)) {
-                       if (!W_ERROR_EQUAL(err, DNS_ERR(NAME_ERROR))) {
-                               return tevent_req_post(req, ev);
-                       }
+                       return tevent_req_post(req, ev);
                }
+
                tevent_req_done(req);
                return tevent_req_post(req, ev);
        }