diff options
author | Kamil Kisiel <kamil@kamilkisiel.net> | 2015-02-23 18:52:10 +0300 |
---|---|---|
committer | Kamil Kisiel <kamil@kamilkisiel.net> | 2015-02-23 18:52:35 +0300 |
commit | 39dd83d692d0cb984af851b38e89b0cd8ea302b6 (patch) | |
tree | abf595ff660aa2c08b251c11a9d1d11b49274a17 | |
parent | 13c86220d944600e7a6e3de6c87418896ccfbe77 (diff) |
ensure FilesystemStore closes the file even on error.
Fixes #41
-rw-r--r-- | store.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -222,10 +222,10 @@ func (s *FilesystemStore) save(session *Session) error { if err != nil { return err } + defer fp.Close() if _, err = fp.Write([]byte(encoded)); err != nil { return err } - fp.Close() return nil } |