summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-05-31 10:36:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:46 -0500
commitc27a242130b850ef937bc564d061be62c3b0e701 (patch)
tree380a7ecdc8080fef560d1fc79eee434e6f0a44dd /source4/lib/ldb/ldb_tdb
parentbd22992274bdd286cf635956b4897b50f6377d66 (diff)
downloadsamba-c27a242130b850ef937bc564d061be62c3b0e701.tar.gz
samba-c27a242130b850ef937bc564d061be62c3b0e701.tar.bz2
samba-c27a242130b850ef937bc564d061be62c3b0e701.zip
r15981: we need to initialize 'ret' before 'goto failed'
metze (This used to be commit 941f93f93f3ce9dacaafe80520b8751f738e7032)
Diffstat (limited to 'source4/lib/ldb/ldb_tdb')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
index fe357072e6..b8f4a024d2 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -606,9 +606,8 @@ int ltdb_modify_internal(struct ldb_module *module, const struct ldb_message *ms
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 @@ int ltdb_modify_internal(struct ldb_module *module, const struct ldb_message *ms
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 @@ int ltdb_modify_internal(struct ldb_module *module, const struct ldb_message *ms
/* 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 @@ int ltdb_modify_internal(struct ldb_module *module, const struct ldb_message *ms
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 @@ int ltdb_modify_internal(struct ldb_module *module, const struct ldb_message *ms
goto failed;
}
if (ltdb_index_del_value(module, dn, &msg->elements[i], j) != 0) {
+ ret = LDB_ERR_OTHER;
goto failed;
}
}