r23751: Call tdb_close even when validation was not successful.
authorMichael Adam <obnox@samba.org>
Sun, 8 Jul 2007 22:01:43 +0000 (22:01 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:52 +0000 (12:23 -0500)
Michael

source/lib/util_tdb.c

index 38b928571950044f06e0b5eb1882799d4017fefd..5f9a5115b6bfc61070ad3aa35ff6aa399f419f59 100644 (file)
@@ -994,7 +994,6 @@ static int tdb_validate_child(const char *tdb_path,
                              int pfd)
 {
        int ret = -1;
-       int tfd = -1;
        int num_entries = 0;
        TDB_CONTEXT *tdb = NULL;
        struct tdb_validation_status v_status;
@@ -1012,8 +1011,6 @@ static int tdb_validate_child(const char *tdb_path,
                goto out;
        }
 
-       tfd = tdb_fd(tdb);
-
        /* Check the cache freelist is good. */
        if (tdb_validate_freelist(tdb, &num_entries) == -1) {
                DEBUG(0,("tdb_validate_child: bad freelist in cache %s\n",
@@ -1048,12 +1045,7 @@ static int tdb_validate_child(const char *tdb_path,
 
 out:
        if (tdb) {
-               if (ret == 0) {
-                       tdb_close(tdb);
-               }
-               else if (tfd != -1) {
-                       close(tfd);
-               }
+               tdb_close(tdb);
        }
 
        DEBUG(10, ("tdb_validate_child: writing status to pipe\n"));