brechtsanders / pedeps

Cross-platform C library to read data from PE/PE+ files (the format of Windows .exe and .dll files)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PE files are never closed

opened this issue · comments

In function pefile_open_custom, pe_file->close_fn is never assigned to.
That means that the close_fn will not be called in pefile_close, and handles will be leaked until the used C runtime can no longer open any further files.
The simple fix would be to insert the line
pe_file->close_fn = close_fn;
after
pe_file->seek_fn = seek_fn;

Fixed in 0.1.10