From ada798a3f74f8ea47ea716622f3f337f5fc232e9 Mon Sep 17 00:00:00 2001 From: guangwu Date: Wed, 8 May 2024 20:36:56 +0800 Subject: [PATCH] fix: close resolv.conf Signed-off-by: guoguangwu --- plugins/ipam/host-local/dns.go | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/ipam/host-local/dns.go b/plugins/ipam/host-local/dns.go index 1b3975a59..816c91f7d 100644 --- a/plugins/ipam/host-local/dns.go +++ b/plugins/ipam/host-local/dns.go @@ -28,6 +28,7 @@ func parseResolvConf(filename string) (*types.DNS, error) { if err != nil { return nil, err } + defer fp.Close() dns := types.DNS{} scanner := bufio.NewScanner(fp)