newfd is normally created by mkstemp given the original fd exists.
Otherwise it will created by open from arfname. In the second case
newfd might not get closed. Preventd this by always trying to close
it after errout.
Signed-off-by: Mark Wielaard <mark@klomp.org>
+2021-04-03 Mark Wielaard <mark@klomp.org>
+
+ * ar.c (do_oper_insert): Always close newfd.
+
2021-03-03 Mark Wielaard <mark@klomp.org>
* readelf.c (handle_symtab): Sanity check verneed vna_next,
if (fd != -1)
close (fd);
+ if (newfd != -1)
+ close (newfd);
+
return status;
}