]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
split: cleanup after posix_spawn
authorCollin Funk <collin.funk1@gmail.com>
Thu, 23 Oct 2025 19:35:37 +0000 (12:35 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Thu, 23 Oct 2025 19:42:01 +0000 (12:42 -0700)
* boostrap.conf (gnulib_modules): Add posix_spawn_file_actions_destroy.
* src/split.c (cleanup): Call posix_spawnattr_destroy and
posix_spawn_file_actions_destroy after a successful posix_spawn.

bootstrap.conf
src/split.c

index fdab0725f1c1444621c7c3bb90641e6387f404a7..4d401d2eb55cb1d5952e79a09c47016b2afe8581 100644 (file)
@@ -220,6 +220,7 @@ gnulib_modules="
   posix_spawnattr_setsigdefault
   posix_spawn_file_actions_addclose
   posix_spawn_file_actions_adddup2
+  posix_spawn_file_actions_destroy
   posix_spawn_file_actions_init
   posix_spawnp
   posixtm
index 077e30f0d76b8b9abb5bdd606556b931ba5e728b..3d15091139709e2816e969926c7c5f2c300d32db 100644 (file)
@@ -561,6 +561,9 @@ create (char const *name)
         error (EXIT_FAILURE, errno, _("failed to run command: \"%s -c %s\""),
                shell_prog, filter_command);
 
+      posix_spawnattr_destroy (&attr);
+      posix_spawn_file_actions_destroy (&actions);
+
       if (close (fd_pair[0]) != 0)
         error (EXIT_FAILURE, errno, _("failed to close input pipe"));
       filter_pid = child_pid;