]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/lib: clang: Fix 'access to field results in a deref of a null pointer'
authorNoel Power <noel.power@suse.com>
Tue, 9 Jul 2019 16:07:09 +0000 (16:07 +0000)
committerGary Lockyer <gary@samba.org>
Wed, 24 Jul 2019 22:50:27 +0000 (22:50 +0000)
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 <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Wed Jul 24 22:50:27 UTC 2019 on sn-devel-184

source3/lib/ctdbd_conn.c

index a8f0036845c157ed1115f034681ddef3e0780f6f..8a8fbec45524109cf05ae70e00f3e5c0f668bb0e 100644 (file)
@@ -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;
        }