s4:dsdb Don't cast an ldb_val into a const char * for schema lookups
[ira/wip.git] / source4 / dsdb / samdb / ldb_modules / schema_fsmo.c
index 1b8f786c3542eb8378da899f5e47e6fe65f3f3c8..290232bdb99f0a0da01896f82306afba7fced284 100644 (file)
@@ -417,9 +417,8 @@ static int generate_possibleInferiors(struct ldb_context *ldb, struct ldb_messag
        }
 
        first_component_val = ldb_dn_get_component_val(dn, 0);
-       class_name = (const char *)first_component_val->data;
 
-       schema_class = dsdb_class_by_cn(schema, class_name);
+       schema_class = dsdb_class_by_cn_ldb_val(schema, first_component_val);
        if (schema_class == NULL) {
                return LDB_SUCCESS;
        }