From 53abaf86c6618e74c2563ea6c7fff71ca58cf920 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Fri, 22 Apr 2016 11:37:20 -0700 Subject: [PATCH] etcdctl/ctlv3: close bolt.DB in snapshot status --- etcdctl/ctlv3/command/snapshot_command.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etcdctl/ctlv3/command/snapshot_command.go b/etcdctl/ctlv3/command/snapshot_command.go index d642fefb1..63cdf84f3 100644 --- a/etcdctl/ctlv3/command/snapshot_command.go +++ b/etcdctl/ctlv3/command/snapshot_command.go @@ -305,10 +305,11 @@ func dbStatus(p string) dbstatus { ds := dbstatus{} - db, err := bolt.Open(p, 0600, nil) + db, err := bolt.Open(p, 0400, nil) if err != nil { ExitWithError(ExitError, err) } + defer db.Close() h := crc32.New(crc32.MakeTable(crc32.Castagnoli))