s3: Fix Coverity ID 2744: CHECKED_RETURN
authorVolker Lendecke <vl@samba.org>
Thu, 19 Apr 2012 08:47:07 +0000 (10:47 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 19 Apr 2012 15:37:38 +0000 (17:37 +0200)
source3/lib/dbwrap/dbwrap_tdb.c

index 2041613be2dc913e8d76b070f8f675685ecc1657..59ed7910f70187f325cf3ae8c1ef6f2869d32ed5 100644 (file)
@@ -110,7 +110,12 @@ static struct db_record *db_tdb_fetch_locked_internal(
        state.mem_ctx = mem_ctx;
        state.result = NULL;
 
-       tdb_parse_record(ctx->wtdb->tdb, key, db_tdb_fetchlock_parse, &state);
+       if ((tdb_parse_record(ctx->wtdb->tdb, key, db_tdb_fetchlock_parse,
+                             &state) < 0) &&
+           (tdb_error(ctx->wtdb->tdb) != TDB_ERR_NOEXIST)) {
+               tdb_chainunlock(ctx->wtdb->tdb, key);
+               return NULL;
+       }
 
        if (state.result == NULL) {
                db_tdb_fetchlock_parse(key, tdb_null, &state);