From: Nick Alcock Date: Thu, 4 Jun 2020 18:49:36 +0000 (+0100) Subject: libctf, link: fix ctf_link_write fd leak X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e3f17159e26fc9b10625725e4d544693741cddb8;p=binutils-gdb.git libctf, link: fix ctf_link_write fd leak We were leaking the fd on every invocation. libctf/ * ctf-link.c (ctf_link_write): Close the fd. --- diff --git a/libctf/ChangeLog b/libctf/ChangeLog index c3451ee5aa6..848bc48b1e8 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,3 +1,7 @@ +2020-07-22 Nick Alcock + + * ctf-link.c (ctf_link_write): Close the fd. + 2020-07-22 Nick Alcock * Makefile.am: Set -DNOBFD=1 in libctf-nobfd, and =0 elsewhere. diff --git a/libctf/ctf-link.c b/libctf/ctf-link.c index 705701d0eb5..fa15c9bf9bb 100644 --- a/libctf/ctf-link.c +++ b/libctf/ctf-link.c @@ -1071,6 +1071,7 @@ ctf_link_write (ctf_file_t *fp, size_t *size, size_t threshold) free (arg.dynames[i]); free (arg.dynames); } + fclose (f); return buf; err_no: