diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2019-07-31 10:16:37 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-07-31 02:50:24 +0000 |
commit | a5ec857abe99748dd478cdc988fa3399401334dc (patch) | |
tree | 72a5353d35e0ad596606c854fea47d76e5ba742e /source4 | |
parent | 35c54007e6183829d9d85a24b3bd95f469739ad3 (diff) | |
download | samba-a5ec857abe99748dd478cdc988fa3399401334dc.tar.gz |
CID 1452109: dsdb/util: do not check for NULL after deref
This is all strictly unnecessary, as ret is always != LDB_SUCCESS when
res is NULL, but we want to make peace between clang and converity.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/dsdb/common/util.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 51d6b243347..1c71c243ed5 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -3582,18 +3582,12 @@ int samdb_dns_host_name(struct ldb_context *sam_ctx, const char **host_name) ret = dsdb_search_dn(sam_ctx, tmp_ctx, &res, NULL, attrs, 0); - if (res->count != 1 || ret != LDB_SUCCESS) { + if (res == NULL || res->count != 1 || ret != LDB_SUCCESS) { DEBUG(0, ("Failed to get rootDSE for dnsHostName: %s", ldb_errstring(sam_ctx))); TALLOC_FREE(tmp_ctx); return ret; } - /* satisfy clang */ - if (res == NULL) { - TALLOC_FREE(tmp_ctx); - return LDB_ERR_OTHER; - } - _host_name = ldb_msg_find_attr_as_string(res->msgs[0], "dnsHostName", |