brechtsanders / pedeps

Cross-platform C library to read data from PE/PE+ files (the format of Windows .exe and .dll files)
MIT License
38 stars 8 forks source link

PE files are never closed #6

Closed ghost closed 3 years ago

ghost commented 4 years ago

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;

brechtsanders commented 3 years ago

Fixed in 0.1.10