Return early with dn->ext_comp_num==0, no need to check further down again.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
TYPESAFE_QSORT(dn->ext_components, dn->ext_comp_num,
ldb_dn_extended_component_compare);
+ if (dn->ext_comp_num == 0) {
+ return NULL;
+ }
+
for (i = 0; i < dn->ext_comp_num; i++) {
const struct ldb_dn_extended_syntax *ext_syntax;
const char *name = dn->ext_components[i].name;
talloc_free(val.data);
}
- if (dn->ext_comp_num && *linearized) {
+ if (*linearized) {
talloc_asprintf_addbuf(&p, ";%s", linearized);
}
- if (!p) {
- return NULL;
- }
-
return p;
}