svn commit: samba r15981 - in
branches/SAMBA_4_0/source/lib/ldb/ldb_tdb: .
metze at samba.org
metze at samba.org
Wed May 31 10:36:48 GMT 2006
Author: metze
Date: 2006-05-31 10:36:48 +0000 (Wed, 31 May 2006)
New Revision: 15981
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15981
Log:
we need to initialize 'ret' before 'goto failed'
metze
Modified:
branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c 2006-05-31 10:32:12 UTC (rev 15980)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c 2006-05-31 10:36:48 UTC (rev 15981)
@@ -606,9 +606,8 @@
ret = ltdb_unpack_data(module, &tdb_data, msg2);
if (ret == -1) {
- talloc_free(tdb_key.dptr);
- free(tdb_data.dptr);
- return LDB_ERR_OTHER;
+ ret = LDB_ERR_OTHER;
+ goto failed;
}
if (!msg2->dn) {
@@ -654,8 +653,10 @@
vals = talloc_realloc(msg2->elements, el2->values, struct ldb_val,
el2->num_values + el->num_values);
- if (vals == NULL)
+ if (vals == NULL) {
+ ret = LDB_ERR_OTHER;
goto failed;
+ }
for (j=0;j<el->num_values;j++) {
vals[el2->num_values + j] =
@@ -675,6 +676,7 @@
/* add the replacement element, if not empty */
if (msg->elements[i].num_values != 0 &&
msg_add_element(ldb, msg2, &msg->elements[i]) != 0) {
+ ret = LDB_ERR_OTHER;
goto failed;
}
break;
@@ -682,7 +684,10 @@
case LDB_FLAG_MOD_DELETE:
dn = ldb_dn_linearize(msg2, msg->dn);
- if (dn == NULL) goto failed;
+ if (dn == NULL) {
+ ret = LDB_ERR_OTHER;
+ goto failed;
+ }
/* we could be being asked to delete all
values or just some values */
@@ -707,6 +712,7 @@
goto failed;
}
if (ltdb_index_del_value(module, dn, &msg->elements[i], j) != 0) {
+ ret = LDB_ERR_OTHER;
goto failed;
}
}
More information about the samba-cvs
mailing list