ctdb-common: Avoid any processing after finishing tevent_req
authorAmitay Isaacs <amitay@gmail.com>
Wed, 11 Jan 2017 08:54:36 +0000 (19:54 +1100)
committerStefan Metzmacher <metze@samba.org>
Mon, 16 Jan 2017 16:26:26 +0000 (17:26 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12510

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
ctdb/common/sock_daemon.c

index 08102c38642332fc2dc7fdb562f66e76f20db00f..3b679ab133263de6520b50b457fdc88174736b0e 100644 (file)
@@ -703,13 +703,12 @@ static void sock_daemon_run_socket_fail(struct tevent_req *subreq)
 
        status = sock_socket_start_recv(subreq, &ret);
        TALLOC_FREE(subreq);
+       sock_daemon_run_shutdown(req);
        if (! status) {
                tevent_req_error(req, ret);
        } else {
                tevent_req_done(req);
        }
-
-       sock_daemon_run_shutdown(req);
 }
 
 static void sock_daemon_run_watch_pid(struct tevent_req *subreq)