svn commit: samba r19898 - in
branches/SAMBA_3_0/source/lib/ldb/common: .
vlendec at samba.org
vlendec at samba.org
Sat Nov 25 17:07:49 GMT 2006
Author: vlendec
Date: 2006-11-25 17:07:49 +0000 (Sat, 25 Nov 2006)
New Revision: 19898
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19898
Log:
Fix klokwork ids 3127, 3128, 3129, 3130
Modified:
branches/SAMBA_3_0/source/lib/ldb/common/ldb_dn.c
Changeset:
Modified: branches/SAMBA_3_0/source/lib/ldb/common/ldb_dn.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/common/ldb_dn.c 2006-11-25 17:00:55 UTC (rev 19897)
+++ branches/SAMBA_3_0/source/lib/ldb/common/ldb_dn.c 2006-11-25 17:07:49 UTC (rev 19898)
@@ -441,7 +441,9 @@
*/
/* Allocate a structure to hold the exploded DN */
- edn = ldb_dn_new(mem_ctx);
+ if (!(edn = ldb_dn_new(mem_ctx))) {
+ return NULL;
+ }
edn->comp_num = 1;
edn->components = talloc(edn, struct ldb_dn_component);
@@ -713,7 +715,10 @@
}
offset = old->comp_num - old_base->comp_num;
- new_dn = ldb_dn_copy_partial(mem_ctx, new_base, offset + new_base->comp_num);
+ if (!(new_dn = ldb_dn_copy_partial(mem_ctx, new_base,
+ offset + new_base->comp_num))) {
+ return NULL;
+ }
for (i = 0; i < offset; i++) {
new_dn->components[i] = ldb_dn_copy_component(new_dn->components, &(old->components[i]));
}
@@ -815,6 +820,7 @@
newdn->comp_num = 1;
newdn->components = talloc_array(newdn, struct ldb_dn_component, newdn->comp_num);
+ LDB_DN_NULL_FAILED(newdn->components);
}
newdn->components[0].name = talloc_strdup(newdn->components, attr);
@@ -847,6 +853,7 @@
newdn->comp_num = dn1->comp_num;
newdn->components = talloc_array(newdn, struct ldb_dn_component, newdn->comp_num);
+ LDB_DN_NULL_FAILED(newdn->components);
} else {
int comp_num = dn2->comp_num;
if (dn1 != NULL) comp_num += dn1->comp_num;
More information about the samba-cvs
mailing list