Skip to content

Commit

Permalink
Do not segfault on hard stop
Browse files Browse the repository at this point in the history
Podman machine on MAC can segfault on hard stop.

Fixes: 23654

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Aug 19, 2024
1 parent 84126fd commit 4f02e65
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/machine/apple/vfkit/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ func (vf *Helper) stateChange(newState rest.StateChange) error {
}
payload := bytes.NewReader(b)
serverResponse, err := vf.post(vf.Endpoint+state, payload)
_ = serverResponse.Body.Close()
return err
if err != nil {
return err
}
return serverResponse.Body.Close()
}

func (vf *Helper) Stop(force, wait bool) error {
Expand Down

0 comments on commit 4f02e65

Please sign in to comment.