bpo-20104: Fix memory leaks and error handling in posix spawn by pablogsal · Pull Request #5418 · python/cpython (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this ever fails, you have an infinite loop.
file_actionsp is only initialized halfway down. In C99 I understand the goto statements above it are allowed to bypass the initialization, but they leave the pointer uninitialized.
Also, I haven’t seen any explicit mention of destroy accepting a null pointer. Did you test this? Even if it works on one platform, it seems risky to rely on it on all Posix platforms.