mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
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>
This commit is contained in:
parent
35c54007e6
commit
a5ec857abe
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user