Close fd in case fd.Write() returns error

Signed-off-by: Ted Yu <yuzhihong@gmail.com>
This commit is contained in:
Ted Yu 2020-05-02 20:06:08 -07:00
parent dd8d48ede8
commit db29dce076
1 changed files with 1 additions and 1 deletions

View File

@ -886,10 +886,10 @@ func waitForCriuLazyServer(r *os.File, status string) error {
return err
}
_, err = fd.Write(data)
fd.Close()
if err != nil {
return err
}
fd.Close()
return nil
}