struct wrepl_request_state);
struct tevent_req *subreq;
+ if (state->caller.wrepl_socket->stream == NULL) {
+ tevent_req_nterror(req, NT_STATUS_INVALID_CONNECTION);
+ return;
+ }
+
if (DEBUGLVL(10)) {
DEBUG(10,("Sending WINS packet of length %u\n",
(unsigned)state->req.blob.length));
TALLOC_FREE(subreq);
if (ret == -1) {
NTSTATUS status = map_nt_error_from_unix(sys_errno);
+ TALLOC_FREE(state->caller.wrepl_socket->stream);
tevent_req_nterror(req, status);
return;
}
+ if (state->caller.wrepl_socket->stream == NULL) {
+ tevent_req_nterror(req, NT_STATUS_INVALID_CONNECTION);
+ return;
+ }
+
if (state->ctrl.disconnect_after_send) {
subreq = tstream_disconnect_send(state,
state->caller.ev,
TALLOC_FREE(subreq);
if (ret == -1) {
NTSTATUS status = map_nt_error_from_unix(sys_errno);
+ TALLOC_FREE(state->caller.wrepl_socket->stream);
tevent_req_nterror(req, status);
return;
}
DEBUG(10,("WINS connection disconnected\n"));
- state->caller.wrepl_socket->stream = NULL;
+ TALLOC_FREE(state->caller.wrepl_socket->stream);
tevent_req_done(req);
}
status = tstream_read_pdu_blob_recv(subreq, state, &state->rep.blob);
if (!NT_STATUS_IS_OK(status)) {
+ TALLOC_FREE(state->caller.wrepl_socket->stream);
tevent_req_nterror(req, status);
return;
}
NTSTATUS status;
if (tevent_req_is_nterror(req, &status)) {
+ TALLOC_FREE(state->caller.wrepl_socket->stream);
tevent_req_received(req);
return status;
}