From: Noel Power Date: Wed, 3 Jul 2019 12:45:56 +0000 (+0000) Subject: s3/lib: Fix Access to field results in dereference of NULL pointer X-Git-Tag: samba-4.11.0rc1~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=96e00a525876ba13250c6428c014d58464fcf5f3;p=thirdparty%2Fsamba.git s3/lib: Fix Access to field results in dereference of NULL pointer Fixes: ource3/lib/messages_dgm.c:176:29: warning: Access to field 'queue' results in a dereference of a null pointer (loaded from variable 'out') <--[clang] qlen = tevent_queue_length(out->queue); Signed-off-by: Noel Power Reviewed-by: Gary Lockyer --- diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c index 60a12e2008f..11cb6969e73 100644 --- a/source3/lib/messages_dgm.c +++ b/source3/lib/messages_dgm.c @@ -323,6 +323,13 @@ static int messaging_dgm_out_get(struct messaging_dgm_context *ctx, pid_t pid, } messaging_dgm_out_rearm_idle_timer(out); + /* + * shouldn't be possible, should be set if messaging_dgm_out_create + * succeeded. This check is to satisfy static checker + */ + if (out == NULL) { + return EINVAL; + } *pout = out; return 0;