mirror of
https://github.com/samba-team/samba.git
synced 2025-09-21 21:44:21 +03:00
r19079: talloc_array can fail
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
2b3b9ce2a1
commit
7b6738522a
@@ -698,6 +698,7 @@ struct ldb_dn *ldb_dn_copy_partial(void *mem_ctx, const struct ldb_dn *dn, int n
|
|||||||
newdn->comp_num = num_el;
|
newdn->comp_num = num_el;
|
||||||
n = newdn->comp_num - 1;
|
n = newdn->comp_num - 1;
|
||||||
newdn->components = talloc_array(newdn, struct ldb_dn_component, newdn->comp_num);
|
newdn->components = talloc_array(newdn, struct ldb_dn_component, newdn->comp_num);
|
||||||
|
if (newdn->components == NULL) goto failed;
|
||||||
|
|
||||||
if (dn->comp_num == 0) return newdn;
|
if (dn->comp_num == 0) return newdn;
|
||||||
e = dn->comp_num - 1;
|
e = dn->comp_num - 1;
|
||||||
|
Reference in New Issue
Block a user