Skip to content

Commit

Permalink
client/tailscale: Fix NPE caused by erroneous close in error case
Browse files Browse the repository at this point in the history
Fixes #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>
  • Loading branch information
twitchyliquid64 committed Apr 3, 2023
1 parent 59879e5 commit 483109b
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion client/tailscale/localclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,6 @@ func (lc *LocalClient) StreamDebugCapture(ctx context.Context) (io.ReadCloser, e
}
res, err := lc.doLocalRequestNiceError(req)
if err != nil {
res.Body.Close()
return nil, err
}
if res.StatusCode != 200 {
Expand Down

0 comments on commit 483109b

Please sign in to comment.