ctdb: Do not leak fd handle in control_restoredb()
authorAndreas Schneider <asn@samba.org>
Thu, 16 Feb 2017 15:55:35 +0000 (16:55 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 17 Feb 2017 17:43:15 +0000 (18:43 +0100)
Found by covscan.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12592

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Feb 17 18:43:16 CET 2017 on sn-devel-144

ctdb/tools/ctdb.c

index 050906c510d4a1906c63c7a7286715adfdf8468d..ae74ef818cbd4bbaa3a73788095b158b6b511084 100644 (file)
@@ -4403,6 +4403,7 @@ static int control_restoredb(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
        }
 
        printf("Database %s restored\n", db_name);
+       close(fd);
        return 0;