From 3a2cbda7f23ac0e854fdf99e30af17488c33b143 Mon Sep 17 00:00:00 2001 From: divolgin Date: Thu, 14 Jul 2016 17:49:07 -0700 Subject: [PATCH] Close snapshot and iterator when creating ledis dump (#245) --- ledis/dump.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ledis/dump.go b/ledis/dump.go index 9ec66b9..3e01ec2 100644 --- a/ledis/dump.go +++ b/ledis/dump.go @@ -60,6 +60,7 @@ func (l *Ledis) Dump(w io.Writer) error { l.wLock.Unlock() return err } + defer snap.Close() l.wLock.Unlock() @@ -72,6 +73,7 @@ func (l *Ledis) Dump(w io.Writer) error { } it := snap.NewIterator() + defer it.Close() it.SeekToFirst() compressBuf := make([]byte, 4096)