17344: Fix unclosed response body.
authorTom Clegg <tom@curii.com>
Thu, 14 Jul 2022 04:58:15 +0000 (00:58 -0400)
committerTom Clegg <tom@curii.com>
Thu, 14 Jul 2022 13:21:42 +0000 (09:21 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

lib/install/init.go

index a341155ab3552858cb0675706832ccf25188dea0..b48edcd4a544481fe898cea0e7adda8147c75f1d 100644 (file)
@@ -494,6 +494,9 @@ func (initcmd *initCommand) checkPortOnce(ctx context.Context, port string) erro
                return err
        }
        resp, err := http.DefaultClient.Do(req)
+       if err == nil {
+               defer resp.Body.Close()
+       }
        if errServe, _ := errServe.Load().(error); errServe != nil {
                // If server already exited, return that error
                // (probably "can't listen"), not the request error.