Skip to content

Commit

Permalink
Fix subprocess I/O handler leakage
Browse files Browse the repository at this point in the history
  • Loading branch information
0x6475796e6861 committed Oct 10, 2022
1 parent 37092bd commit ba1bc9b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libnmap/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ def run(self):
# Call the callback one last time to signal the new state
if self.__nmap_event_callback:
self.__nmap_event_callback(self)

# Close I/O handlers before exiting
self.__nmap_proc.stdout.close()
self.__nmap_proc.stderr.close()

return self.rc

def run_background(self):
Expand Down

0 comments on commit ba1bc9b

Please sign in to comment.