s4/dsdb/common: clang: Fix 'Access results in a deref of a null pointer'
commit55f18757aae0f7fb137217e42ced6e2e08bfbfa2
authorNoel Power <noel.power@suse.com>
Fri, 5 Jul 2019 11:07:07 +0000 (5 11:07 +0000)
committerGary Lockyer <gary@samba.org>
Wed, 24 Jul 2019 04:19:27 +0000 (24 04:19 +0000)
tree5209641a697dc4fd57a27f4962801c4e929d7971
parentbd86df913b14070e157b6a9178438f71321c8872
s4/dsdb/common: clang: Fix 'Access results in a deref of a null pointer'

Fixes:

source4/dsdb/common/util.c:2000:6: warning: Access to field 'count' results in a dereference of a null pointer (loaded from variable 'res') <--[clang]
        if (res->count != 1) {
            ^~~

source4/dsdb/common/util.c:3281:28: warning: Access to field 'msgs' results in a dereference of a null pointer (loaded from variable 'res') <--[clang]
        el = ldb_msg_find_element(res->msgs[0], attr);
                                  ^~~
source4/dsdb/common/util.c:3568:6: warning: Access to field 'count' results in a dereference of a null pointer (loaded from variable 'res') <--[clang]
        if (res->count != 1 || ret != LDB_SUCCESS) {
            ^~~

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source4/dsdb/common/util.c