diff options
author | Andy Pan <panjf2000@gmail.com> | 2022-11-16 12:46:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-16 06:46:28 +0200 |
commit | c367454ffe184d396c0fabc40e7b365e4c40231f (patch) | |
tree | 203e48dc8fc922f59dd5736643408c61dbacf42c /client.go | |
parent | Use time.Until(deadline) instead of -time.Since(deadline) (#1434) (diff) | |
download | fasthttp-c367454ffe184d396c0fabc40e7b365e4c40231f.tar.gz fasthttp-c367454ffe184d396c0fabc40e7b365e4c40231f.tar.bz2 fasthttp-c367454ffe184d396c0fabc40e7b365e4c40231f.zip |
Fix some potential pool leaks (#1433)
Diffstat (limited to 'client.go')
-rw-r--r-- | client.go | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -983,6 +983,8 @@ var clientURLResponseChPool sync.Pool func clientPostURL(dst []byte, url string, postArgs *Args, c clientDoer) (statusCode int, body []byte, err error) { req := AcquireRequest() + defer ReleaseRequest(req) + req.Header.SetMethod(MethodPost) req.Header.SetContentTypeBytes(strPostArgsContentType) if postArgs != nil { @@ -993,7 +995,6 @@ func clientPostURL(dst []byte, url string, postArgs *Args, c clientDoer) (status statusCode, body, err = doRequestFollowRedirectsBuffer(req, dst, url, c) - ReleaseRequest(req) return statusCode, body, err } |