Skip to content

Commit

Permalink
maj:poll ping: read body to avoid mem leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
burgesQ committed May 23, 2023
1 parent f184fb9 commit c9ecbe3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion poll_ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package webfmwk

import (
"context"
"io"
"net/http"
"strings"
"time"
Expand Down Expand Up @@ -64,7 +65,8 @@ func (s *Server) pollPingEndpoint(addr string, cfg ...tls.IConfig) {
continue
}

resp.Body.Close()
defer resp.Body.Close()
_, _ = io.ReadAll(resp.Body)

return

Expand Down

0 comments on commit c9ecbe3

Please sign in to comment.