Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2234 from tedyu/close-cf
Browse files Browse the repository at this point in the history
vc: Persist file handle may leak in FS#FromDisk
  • Loading branch information
Julio Montes authored Nov 21, 2019
2 parents 88205cf + 2331e87 commit 3a4025f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion virtcontainers/persist/fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ func (fs *FS) FromDisk(sid string) (persistapi.SandboxState, map[string]persista
return ss, nil, err
}

defer cf.Close()
var cstate persistapi.ContainerState
if err := json.NewDecoder(cf).Decode(&cstate); err != nil {
return ss, nil, err
}
cf.Close()

fs.containerState[cid] = cstate
}
Expand Down

0 comments on commit 3a4025f

Please sign in to comment.