1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s4/messaging: do not deref NULL state (CID 1437973)

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall 2019-05-08 15:58:08 +12:00 committed by Andrew Bartlett
parent a82f924179
commit 597709aac9

View File

@ -578,6 +578,10 @@ static void imessaging_post_handler(struct tevent_context *ev,
struct imessaging_post_state *state = talloc_get_type_abort(
private_data, struct imessaging_post_state);
if (state == NULL) {
return;
}
/*
* In usecases like using messaging_client_init() with irpc processing
* we may free the imessaging_context during the messaging handler.
@ -594,10 +598,6 @@ static void imessaging_post_handler(struct tevent_context *ev,
imessaging_dgm_recv(ev, state->buf, state->buf_len, NULL, 0,
state->msg_ctx);
if (state == NULL) {
return;
}
state->busy_ref = NULL;
TALLOC_FREE(state);
}