nm: Fix file descriptor leak on dwfl_begin failure.
authorMark Wielaard <mark@klomp.org>
Sat, 3 Apr 2021 17:52:38 +0000 (19:52 +0200)
committerMark Wielaard <mark@klomp.org>
Tue, 13 Apr 2021 12:45:34 +0000 (14:45 +0200)
commit879513aba0b765c5552fc371c7fc55df4135661e
treed5066b003bd6d1d21738c1f74a9c7e2faefb844d
parent1261691accb3f224ebbaef438a641273c4c3c49f
nm: Fix file descriptor leak on dwfl_begin failure.

If dwfl_begin fails we won't use the dwfl_fd descriptor we just dupped.
Make sure to close on dwfl_begin failure to avoid the leak.

Signed-off-by: Mark Wielaard <mark@klomp.org>
src/ChangeLog
src/nm.c