summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/simple_ldap_map.c2
-rw-r--r--source4/lib/ldb/pyldb.c3
-rw-r--r--source4/rpc_server/drsuapi/getncchanges.c6
3 files changed, 4 insertions, 7 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
index fce4592895..7412d29267 100644
--- a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
+++ b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
@@ -147,7 +147,7 @@ static struct ldb_val objectCategory_always_dn(struct ldb_module *module, TALLOC
const struct ldb_schema_attribute *a = ldb_schema_attribute_by_name(ldb, "objectCategory");
dn = ldb_dn_from_ldb_val(ctx, ldb, val);
- if (dn && ldb_dn_validate(dn)) {
+ if (ldb_dn_validate(dn)) {
talloc_free(dn);
return val_copy(module, ctx, val);
}
diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c
index c1962e612f..d14487ba02 100644
--- a/source4/lib/ldb/pyldb.c
+++ b/source4/lib/ldb/pyldb.c
@@ -553,8 +553,7 @@ static PyObject *py_ldb_dn_new(PyTypeObject *type, PyObject *args, PyObject *kwa
}
ret = ldb_dn_new(mem_ctx, ldb_ctx, str);
-
- if (ret == NULL || !ldb_dn_validate(ret)) {
+ if (!ldb_dn_validate(ret)) {
talloc_free(mem_ctx);
PyErr_SetString(PyExc_ValueError, "unable to parse dn string");
return NULL;
diff --git a/source4/rpc_server/drsuapi/getncchanges.c b/source4/rpc_server/drsuapi/getncchanges.c
index b7431b6702..8ae536823d 100644
--- a/source4/rpc_server/drsuapi/getncchanges.c
+++ b/source4/rpc_server/drsuapi/getncchanges.c
@@ -621,8 +621,7 @@ static WERROR getncchanges_rid_alloc(struct drsuapi_bind_state *b_state,
}
req_dn = drs_ObjectIdentifier_to_dn(mem_ctx, ldb, req10->naming_context);
- if (!req_dn ||
- !ldb_dn_validate(req_dn) ||
+ if (!ldb_dn_validate(req_dn) ||
ldb_dn_compare(req_dn, rid_manager_dn) != 0) {
/* that isn't the RID Manager DN */
DEBUG(0,(__location__ ": RID Alloc request for wrong DN %s\n",
@@ -964,8 +963,7 @@ static WERROR getncchanges_change_master(struct drsuapi_bind_state *b_state,
*/
req_dn = drs_ObjectIdentifier_to_dn(mem_ctx, ldb, req10->naming_context);
- if (!req_dn ||
- !ldb_dn_validate(req_dn)) {
+ if (!ldb_dn_validate(req_dn)) {
/* that is not a valid dn */
DEBUG(0,(__location__ ": FSMO role transfer request for invalid DN %s\n",
drs_ObjectIdentifier_to_string(mem_ctx, req10->naming_context)));