public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4375] collect2: Fix missing cleanups.
@ 2021-10-13 16:06 Iain D Sandoe
0 siblings, 0 replies; only message in thread
From: Iain D Sandoe @ 2021-10-13 16:06 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:43ae43f654749d291d871ca6ef7c96ea16580fad
commit r12-4375-g43ae43f654749d291d871ca6ef7c96ea16580fad
Author: Iain Sandoe <iain@sandoe.co.uk>
Date: Wed Oct 6 14:58:33 2021 +0100
collect2: Fix missing cleanups.
The code that checks to see if objects have LTO content via
simple-object was not releasing resources, fixed thus.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/ChangeLog:
* collect2.c (is_lto_object_file): Release simple-object
resources, close files.
Diff:
---
gcc/collect2.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gcc/collect2.c b/gcc/collect2.c
index cf04a58ba4d..d47fe3f9195 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -2299,10 +2299,15 @@ is_lto_object_file (const char *prog_name)
LTO_SEGMENT_NAME,
&errmsg, &err);
if (!inobj)
- return false;
+ {
+ close (infd);
+ return false;
+ }
errmsg = simple_object_find_sections (inobj, has_lto_section,
(void *) &found, &err);
+ simple_object_release_read (inobj);
+ close (infd);
if (! errmsg && found)
return true;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-10-13 16:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 16:06 [gcc r12-4375] collect2: Fix missing cleanups Iain D Sandoe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).