rpc_server: Fix some uses of tevent_req_nomem
authorVolker Lendecke <vl@samba.org>
Sun, 27 Oct 2013 14:27:45 +0000 (15:27 +0100)
committerAndreas Schneider <asn@samba.org>
Mon, 28 Oct 2013 07:26:42 +0000 (08:26 +0100)
tevent_req_nomem is to be used in a sequence of async actions where we
have one main request. This is a completely independent loop without one
central tevent_req. tevent_req_nomem is used as a simple way to signal
an out of memory condition to the main request representing the async
sequence. If we don't have such a tevent_req, we need to directly check
for NULL.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/rpc_server/rpc_ep_register.c

index d840c2e09e369e68ccaa3231ba60e4679cd9a3ec..1b8ea0918c7b35f93b67a29cc0e41697f8b6bab4 100644 (file)
@@ -83,7 +83,7 @@ NTSTATUS rpc_ep_register(struct tevent_context *ev_ctx,
        req = tevent_wakeup_send(state->mem_ctx,
                                 state->ev_ctx,
                                 timeval_current_ofs(1, 0));
-       if (tevent_req_nomem(state->mem_ctx, req)) {
+       if (req == NULL) {
                talloc_free(state);
                return NT_STATUS_NO_MEMORY;
        }
@@ -121,7 +121,7 @@ static void rpc_ep_register_loop(struct tevent_req *subreq)
                subreq = tevent_wakeup_send(state->mem_ctx,
                                            state->ev_ctx,
                                            timeval_current_ofs(MONITOR_WAIT_TIME, 0));
-               if (tevent_req_nomem(state->mem_ctx, subreq)) {
+               if (subreq == NULL) {
                        talloc_free(state);
                        return;
                }
@@ -140,7 +140,7 @@ static void rpc_ep_register_loop(struct tevent_req *subreq)
        subreq = tevent_wakeup_send(state->mem_ctx,
                                    state->ev_ctx,
                                    timeval_current_ofs(state->wait_time, 0));
-       if (tevent_req_nomem(state->mem_ctx, subreq)) {
+       if (subreq == NULL) {
                talloc_free(state);
                return;
        }
@@ -258,7 +258,7 @@ static void rpc_ep_monitor_loop(struct tevent_req *subreq)
        subreq = tevent_wakeup_send(state->mem_ctx,
                                    state->ev_ctx,
                                    timeval_current_ofs(MONITOR_WAIT_TIME, 0));
-       if (tevent_req_nomem(state->mem_ctx, subreq)) {
+       if (subreq == NULL) {
                talloc_free(state);
                return;
        }