From f8d79d0ecc94760d5a3f9f9847e3f77f604b442d Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 14 Sep 2020 12:54:14 +0200 Subject: [PATCH] dhcp4: close healthiness checking connection --- cmd/dhcp4/dhcp4.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/dhcp4/dhcp4.go b/cmd/dhcp4/dhcp4.go index bbe890d..4ae4605 100644 --- a/cmd/dhcp4/dhcp4.go +++ b/cmd/dhcp4/dhcp4.go @@ -60,6 +60,7 @@ func healthy() error { if err != nil { return err } + defer resp.Body.Close() if got, want := resp.StatusCode, http.StatusOK; got != want { b, _ := ioutil.ReadAll(resp.Body) return fmt.Errorf("%v: got HTTP %v (%s), want HTTP status %v",