]> Cypherpunks repositories - gostls13.git/commit
crypto/internal/boring: don't shadow named returns
authorRoland Shoemaker <roland@golang.org>
Mon, 25 Mar 2024 16:11:26 +0000 (17:11 +0100)
committerGopher Robot <gobot@golang.org>
Tue, 26 Mar 2024 23:38:03 +0000 (23:38 +0000)
commit50dcffb384cf1693fb113de01c8a36debc6086d1
tree9a43bb03d5ae96eb3c05f1ad45af029e8d868b6a
parentb47f2febea5c570fef4a5c27a46473f511fbdaa3
crypto/internal/boring: don't shadow named returns

In setupRSA we use named returns so that we can defer freeing of the
boring private key and context, but were using returns of the form
`return nil, nil, ...` which nil'd the named returns, preventing them
from actually being freed.

Update all of the returns to not shadow the named variables.

Thanks to Quim Muntal of Microsoft for reporting this issue.

Change-Id: Iaf0f0b17e123a7df730cb1e91a324fe622611f66
Reviewed-on: https://go-review.googlesource.com/c/go/+/574195
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Emmanuel Odeke <emmanuel@orijtech.com>
src/crypto/internal/boring/rsa.go