The posix_spawnattr_init & posix_spawn_file_actions_init might fail, but their return code is not checked. Check for non-zero return code and destroy only succesfully initialized objects.
The posix_spawnattr_init & posix_spawn_file_actions_init might fail, but their return code is not checked. Check for non-zero return code and destroy only succesfully initialized objects.