aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2021-10-06 14:58:33 +0100
committerIain Sandoe <iain@sandoe.co.uk>2021-10-13 17:06:36 +0100
commit43ae43f654749d291d871ca6ef7c96ea16580fad (patch)
tree242b099dd1fca6c9df9b98c2ff2d92cbd30b01a0 /gcc
parent5efeaa0d29525fa28e189e6278c1b1651fb0d7bf (diff)
downloadgcc-43ae43f654749d291d871ca6ef7c96ea16580fad.zip
gcc-43ae43f654749d291d871ca6ef7c96ea16580fad.tar.gz
gcc-43ae43f654749d291d871ca6ef7c96ea16580fad.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/collect2.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/collect2.c b/gcc/collect2.c
index cf04a58..d47fe3f 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;