ITADN

Resource leak when `subprocess_create_ex()` fails

#85Closedwn2000 创建于 2024-04-25
W
wn2000commented
The `subprocess_create_ex()` function just has `return -1` in case of an error, without properly closing already open file descriptors. Example: https://github.com/sheredom/subprocess.h/blob/7e59b6924aa0e1a595be86fdeb1d4c28835aa0b9/subprocess.h#L876-L880 In my test, trying to call this function with a non-existing command results in 6 more new FDs each time.
关闭于 2026-05-23 3 条评论