From 3913b9a4088b83d6ed7f94d136a26ecfa7e16b35 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Tue, 9 Jul 2019 16:07:09 +0000 Subject: [PATCH] s3/lib: clang: Fix 'access to field results in a deref of a null pointer' Fixes: source3/lib/ctdbd_conn.c:1953:6: warning: Access to field 'operation' results in a dereference of a null pointer (loaded from variable 'hdr') <--[clang] if (hdr->operation != CTDB_REPLY_CALL) { ^~~ Signed-off-by: Noel Power Reviewed-by: Gary Lockyer Autobuild-User(master): Gary Lockyer Autobuild-Date(master): Wed Jul 24 22:50:27 UTC 2019 on sn-devel-184 --- source3/lib/ctdbd_conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index a8f0036845c..8a8fbec4552 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -1946,7 +1946,7 @@ static void ctdbd_parse_done(struct tevent_req *subreq) ret = ctdb_pkt_recv_recv(subreq, state, &hdr); TALLOC_FREE(subreq); - if (tevent_req_error(req, ret)) { + if ((hdr == NULL) || tevent_req_error(req, ret)) { DBG_ERR("ctdb_pkt_recv_recv returned %s\n", strerror(ret)); return; }