librpc/rpc/pipe_handle.c
[metze/samba/wip.git] / librpc / rpc / pipe_handle.c
index 30231c1ee3d9868f3f3539379b45a1f142350900..2bf67ae8e6c0a3b979c45366e60fc8fecd68090c 100644 (file)
@@ -158,7 +158,7 @@ struct dcerpc_pipe_handle_push_state {
 static int dcerpc_pipe_handle_push_state_destructor(
        struct dcerpc_pipe_handle_push_state *state)
 {
-       if (state->p) {
+       if (state->p != NULL) {
                state->p->current_req = NULL;
        }
 
@@ -226,6 +226,8 @@ static void dcerpc_pipe_handle_push_done(struct tevent_req *subreq)
 
        status = state->ops->chunk_push_recv(subreq);
        TALLOC_FREE(subreq);
+       state->p->current_req = NULL;
+       state->p = NULL;
        if (tevent_req_nterror(req, status)) {
                return;
        }
@@ -246,7 +248,7 @@ struct dcerpc_pipe_handle_pull_state {
 static int dcerpc_pipe_handle_pull_state_destructor(
        struct dcerpc_pipe_handle_pull_state *state)
 {
-       if (state->p) {
+       if (state->p != NULL) {
                state->p->current_req = NULL;
        }
 
@@ -315,6 +317,8 @@ static void dcerpc_pipe_handle_pull_done(struct tevent_req *subreq)
 
        status = state->ops->chunk_pull_recv(subreq);
        TALLOC_FREE(subreq);
+       state->p->current_req = NULL;
+       state->p = NULL;
        if (tevent_req_nterror(req, status)) {
                return;
        }