diff options
| author | Mark Wielaard <[email protected]> | 2021-04-03 19:20:32 +0200 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2021-04-13 14:45:34 +0200 |
| commit | b58516a620c70db026b13f6c36b634d3ae7f1739 (patch) | |
| tree | 8df9df9baf395189aa2816600788a7bac449e973 /src/ar.c | |
| parent | a8e925ec759712f969166d941b82817e9b68cfb9 (diff) | |
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 <[email protected]>
Diffstat (limited to 'src/ar.c')
| -rw-r--r-- | src/ar.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1566,6 +1566,9 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc, if (fd != -1) close (fd); + if (newfd != -1) + close (newfd); + return status; } |
