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)