summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2026-07-19 18:45:56 +0200
committerMark Wielaard <mark@klomp.org>2026-07-19 19:08:32 +0200
commit4d8f3bb6cabf28d7b4842971e8c117a4beebf720 (patch)
treec5bc7aaedb9f6a792083c1299418b3d0d20fa014
parentBump version to 0.17 (diff)
dwz: cleanup allocatable section after non-allocatable errorHEADmaster
In dso_write all errors, except the allocatable section one, unlink the (temp) output file, end the elf and close the fd. * dwz.c (write_dso): Always unlink, elf_end and close after error. Signed-off-by: Mark Wielaard <mark@klomp.org>
-rw-r--r--dwz.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dwz.c b/dwz.c
index a5ce8f8..4fe960d 100644
--- a/dwz.c
+++ b/dwz.c
@@ -14492,6 +14492,9 @@ write_dso (DSO *dso, const char *file, struct stat *st, bool save_to_temp)
14492 { 14492 {
14493 error (0, 0, "Allocatable section in %s after " 14493 error (0, 0, "Allocatable section in %s after "
14494 "non-allocatable ones", dso->filename); 14494 "non-allocatable ones", dso->filename);
14495 unlink (file);
14496 elf_end (elf);
14497 close (fd);
14495 return 1; 14498 return 1;
14496 } 14499 }
14497 else 14500 else