summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-08-25 13:45:40 +0200
committerMichael Adam <obnox@samba.org>2011-08-25 23:55:06 +0200
commit9d3fa10c352ae29091ffa0ef33f43a8c24a7161f (patch)
tree9b1a9ff6cdf79fba618c32a7bc4484f0173c157d /source3/lib/dbwrap
parent316834cf42c352aa8a99f463f35e812fa4f6e397 (diff)
downloadsamba-9d3fa10c352ae29091ffa0ef33f43a8c24a7161f.tar.gz
samba-9d3fa10c352ae29091ffa0ef33f43a8c24a7161f.tar.bz2
samba-9d3fa10c352ae29091ffa0ef33f43a8c24a7161f.zip
s3:dbwrap_tdb: correctly catch the error from the return code of tdb_parse in db_tdb_fetch()
Diffstat (limited to 'source3/lib/dbwrap')
-rw-r--r--source3/lib/dbwrap/dbwrap_tdb.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/lib/dbwrap/dbwrap_tdb.c b/source3/lib/dbwrap/dbwrap_tdb.c
index aca57b63ce..f3528a98c1 100644
--- a/source3/lib/dbwrap/dbwrap_tdb.c
+++ b/source3/lib/dbwrap/dbwrap_tdb.c
@@ -160,12 +160,17 @@ static int db_tdb_fetch(struct db_context *db, TALLOC_CTX *mem_ctx,
db->private_data, struct db_tdb_ctx);
struct tdb_fetch_state state;
+ int ret;
state.mem_ctx = mem_ctx;
state.result = 0;
state.data = tdb_null;
- tdb_parse_record(ctx->wtdb->tdb, key, db_tdb_fetch_parse, &state);
+ ret = tdb_parse_record(ctx->wtdb->tdb, key, db_tdb_fetch_parse, &state);
+
+ if (ret < 0) {
+ return -1;
+ }
if (state.result == -1) {
return -1;