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.
This commit is contained in:
Nick Alcock
2020-06-04 19:49:36 +01:00
parent 8d2229ad1e
commit e3f17159e2
2 changed files with 5 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2020-07-22 Nick Alcock <nick.alcock@oracle.com>
* ctf-link.c (ctf_link_write): Close the fd.
2020-07-22 Nick Alcock <nick.alcock@oracle.com>
* Makefile.am: Set -DNOBFD=1 in libctf-nobfd, and =0 elsewhere.

View File

@ -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: