libipt, ptunit: remove temporary files after closing

In ptunit-section, we create temporary files and remove them again by calling
remove() on the filename while the file is still open.  This may cause remove()
to fail on some systems.  Close the file first.

Change-Id: Ie1ea517accbb95e2cbe76345bbdddb55d5865d11
Signed-off-by: Markus Metzger <>
1 file changed