debug: close binary files
diff --git a/src/debug/macho/file.go b/src/debug/macho/file.go
index 7b11bb2..e226799 100644
--- a/src/debug/macho/file.go
+++ b/src/debug/macho/file.go
@@ -634,6 +634,7 @@
return nil, err
}
if _, err := io.ReadFull(r, dbuf); err != nil {
+ r.Close()
return nil, err
}
if err := r.Close(); err != nil {
diff --git a/src/debug/pe/file.go b/src/debug/pe/file.go
index ed63a11..1bea9ea 100644
--- a/src/debug/pe/file.go
+++ b/src/debug/pe/file.go
@@ -243,6 +243,7 @@
return nil, err
}
if _, err := io.ReadFull(r, dbuf); err != nil {
+ r.Close()
return nil, err
}
if err := r.Close(); err != nil {
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Congratulations on opening your first change. Thank you for your contribution!
Next steps:
A maintainer will review your change and provide feedback. See
https://go.dev/doc/contribute#review for more info and tips to get your
patch through code review.
Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.
During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11 or adds a tag like "wait-release", it means that this CL will be
reviewed as part of the next development cycle. See https://go.dev/s/release
for more details.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks, but I don't think this is worth doing. The Close method is documented as not closing the underlying Reader. The only purpose of closing a zlib Reader is to check for decompression errors. Since this code isn't checking the error result, there is no reason to call Close.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |