From: Douglas Bagnall Date: Wed, 8 May 2019 03:58:08 +0000 (+1200) Subject: s4/messaging: do not deref NULL state (CID 1437973) X-Git-Tag: tdb-1.4.1~109 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=597709aac99d2bccb015806f02049918b1ba79bd;p=thirdparty%2Fsamba.git s4/messaging: do not deref NULL state (CID 1437973) Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index 6cf58539a75..1f27cf74e17 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -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); }