[PATCH] Coverity fixes.
Jeremy Allison
jra at samba.org
Fri Nov 9 23:09:28 UTC 2018
On Sat, Nov 10, 2018 at 12:02:12AM +0100, Stefan Metzmacher wrote:
> Am 09.11.18 um 22:25 schrieb Jeremy Allison via samba-technical:
> > Subject: [PATCH 1/2] s4: lib: messaging. Fix dead code. Coverity CID: 1437973
> >
> > Signed-off-by: Jeremy Allison <jra at samba.org>
> > ---
> > source4/lib/messaging/messaging.c | 4 ----
> > 1 file changed, 4 deletions(-)
> >
> > diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c
> > index 935951f3fba..dada565d1be 100644
> > --- a/source4/lib/messaging/messaging.c
> > +++ b/source4/lib/messaging/messaging.c
> > @@ -470,10 +470,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);
> > }
>
> This is wrong! See a08ab2940051ae47ce71149087a24d060227ef19
>
> imessaging_post_state_destructor() may set state = NULL,
> via the state->busy_ref pointer.
Ah perfect, thanks ! I missed that :-).
Wow, that one is subtle...
Ralph (or metze), please cancel that autobuild.
Maybe a comment might help.
More information about the samba-technical
mailing list