Skip to content

Commit ba1bc9b

Browse files
Fix subprocess I/O handler leakage
1 parent 37092bd commit ba1bc9b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libnmap/process.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,11 @@ def run(self):
327327
# Call the callback one last time to signal the new state
328328
if self.__nmap_event_callback:
329329
self.__nmap_event_callback(self)
330+
331+
# Close I/O handlers before exiting
332+
self.__nmap_proc.stdout.close()
333+
self.__nmap_proc.stderr.close()
334+
330335
return self.rc
331336

332337
def run_background(self):

0 commit comments

Comments
 (0)