}
struct dcerpc_alter_context_state {
+ struct tevent_context *ev;
struct dcerpc_pipe *p;
};
return NULL;
}
+ state->ev = ev;
state->p = p;
p->syntax = *syntax;
struct tevent_req *req =
talloc_get_type_abort(subreq->async.private_data,
struct tevent_req);
+ struct dcerpc_alter_context_state *state =
+ tevent_req_data(req,
+ struct dcerpc_alter_context_state);
NTSTATUS status = subreq->status;
TALLOC_FREE(subreq);
+ /*
+ * We trigger the callback in the next event run
+ * because the code in this file might trigger
+ * multiple request callbacks from within a single
+ * while loop.
+ *
+ * In order to avoid segfaults from within
+ * dcerpc_connection_dead() we call
+ * tevent_req_defer_callback().
+ */
+ tevent_req_defer_callback(req, state->ev);
+
tevent_req_nterror(req, status);
}
talloc_steal(state, raw_packet->data);
TALLOC_FREE(subreq);
+ /*
+ * We trigger the callback in the next event run
+ * because the code in this file might trigger
+ * multiple request callbacks from within a single
+ * while loop.
+ *
+ * In order to avoid segfaults from within
+ * dcerpc_connection_dead() we call
+ * tevent_req_defer_callback().
+ */
+ tevent_req_defer_callback(req, state->ev);
+
if (pkt->ptype == DCERPC_PKT_ALTER_RESP &&
pkt->u.alter_resp.num_results == 1 &&
pkt->u.alter_resp.ctx_list[0].result != 0) {