Skip to content

Commit

Permalink
fix: close file (#4007)
Browse files Browse the repository at this point in the history
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
  • Loading branch information
testwill authored and zhangzujian committed May 11, 2024
1 parent b47f2ce commit be8def3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/ovn_leader_checker/ovn.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ func checkNorthdActive() bool {
klog.Errorf("failed to open %s err = %v", OvnNorthdPid, err)
return false
}
defer file.Close()
fileByte, err := io.ReadAll(file)
if err != nil {
klog.Errorf("failed to read %s err = %v", OvnNorthdPid, err)
Expand Down

0 comments on commit be8def3

Please sign in to comment.