From: Jamie Iles Date: Tue, 4 Nov 2014 13:07:58 +0000 (+0000) Subject: dwarf2ctf: don't leak directory fd. X-Git-Tag: v4.1.12-92~313^2~33 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=049159c06198f0e7ec5047b689542f4139ae39ac;p=users%2Fjedix%2Flinux-maple.git dwarf2ctf: don't leak directory fd. We open a descriptor to the current directory in rel_abs_file_name() but don't close it whilst we're done with resolving the path. Plug the file descriptor leak once we have returned to that directory. Orabug: 19957565 Cc: Nick Alcock Signed-off-by: Jamie Iles Signed-off-by: Guangyu Sun Acked-by: Kris Van Hees --- diff --git a/scripts/dwarf2ctf/dwarf2ctf.c b/scripts/dwarf2ctf/dwarf2ctf.c index dd4511bfd51a..598025f9610e 100644 --- a/scripts/dwarf2ctf/dwarf2ctf.c +++ b/scripts/dwarf2ctf/dwarf2ctf.c @@ -3724,6 +3724,8 @@ static char *rel_abs_file_name(const char *file_name, const char *relative_to) exit(1); } + close(dir); + return abspath; }