1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-01 21:18:10 +03:00

r19075: Fix a potential NULL dereference

This commit is contained in:
Volker Lendecke 2006-10-04 20:15:23 +00:00 committed by Gerald (Jerry) Carter
parent d234f39c79
commit 0ab5d7692c

View File

@ -674,6 +674,7 @@ static struct ldb_dn_component ldb_dn_copy_component(void *mem_ctx, struct ldb_d
dst.name = talloc_strdup(mem_ctx, src->name);
if (dst.name == NULL) {
talloc_free(dst.value.data);
dst.value.data = NULL;
}
return dst;
@ -826,6 +827,9 @@ struct ldb_dn *ldb_dn_compose(void *mem_ctx, const struct ldb_dn *dn1, const str
for (i = 0; i < dn1->comp_num; i++) {
newdn->components[i] = ldb_dn_copy_component(newdn->components,
&(dn1->components[i]));
if (newdn->components[i].value.data == NULL) {
goto failed;
}
}
return newdn;