r19079: talloc_array can fail
authorVolker Lendecke <vlendec@samba.org>
Wed, 4 Oct 2006 20:59:06 +0000 (20:59 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:20:34 +0000 (14:20 -0500)
(This used to be commit 441ad8a45c390f807a6ec5f27d585aad54f3b210)

source4/lib/ldb/common/ldb_dn.c

index f1d0f185ad1f06e4db9fe0b792bbd111523eec50..f9b044d5b84db8abdf034e5c801341561c770b6d 100644 (file)
@@ -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;
        n = newdn->comp_num - 1;
        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;
        e = dn->comp_num - 1;