mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
client/tailscale: Fix NPE caused by erroneous close in error case
Fixes https://github.com/tailscale/tailscale/issues/7572 When handling an error during `StreamDebugCapture`, the response body is closed, even though the response struct is always nil. Thanks to https://github.com/darkrain42 for debugging this!! Signed-off-by: Tom DNetto <tom@tailscale.com>
This commit is contained in:
parent
59879e5770
commit
483109b8fc
@ -1101,7 +1101,6 @@ func (lc *LocalClient) StreamDebugCapture(ctx context.Context) (io.ReadCloser, e
|
|||||||
}
|
}
|
||||||
res, err := lc.doLocalRequestNiceError(req)
|
res, err := lc.doLocalRequestNiceError(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.Body.Close()
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if res.StatusCode != 200 {
|
if res.StatusCode != 200 {
|
||||||
|
Loading…
Reference in New Issue
Block a user