Skip to content

Commit 003875c

Browse files
committed
Fix fd leak
1 parent 079c926 commit 003875c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/api/cache.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ func (c *ScalewayCache) Save() error {
185185
if err != nil {
186186
return err
187187
}
188+
defer file.Close()
188189
encoder := json.NewEncoder(file)
189190
err = encoder.Encode(*c)
190191
if err != nil {

0 commit comments

Comments
 (0)