From 9d3fa10c352ae29091ffa0ef33f43a8c24a7161f Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 25 Aug 2011 13:45:40 +0200 Subject: s3:dbwrap_tdb: correctly catch the error from the return code of tdb_parse in db_tdb_fetch() --- source3/lib/dbwrap/dbwrap_tdb.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/lib/dbwrap') 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; -- cgit