]> git.ipfire.org Git - thirdparty/elfutils.git/commit
ar: Always close newfd in do_oper_insert.
authorMark Wielaard <mark@klomp.org>
Sat, 3 Apr 2021 17:20:32 +0000 (19:20 +0200)
committerMark Wielaard <mark@klomp.org>
Tue, 13 Apr 2021 12:45:34 +0000 (14:45 +0200)
commitb58516a620c70db026b13f6c36b634d3ae7f1739
tree8df9df9baf395189aa2816600788a7bac449e973
parenta8e925ec759712f969166d941b82817e9b68cfb9
ar: Always close newfd in do_oper_insert.

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>
src/ChangeLog
src/ar.c