diff options
author | Bruno Haible <bruno@clisp.org> | 2020-12-10 23:43:20 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-12-11 00:52:28 +0100 |
commit | 800920c4b37502e59927464c05c9ca65db0390e3 (patch) | |
tree | 376b6a4b4bb4c4a3ec345de1cab50abdbcfcdb97 /modules/execute | |
parent | 3cd245c6a6e8823af3a5b23099c84cf99e6a12dc (diff) | |
download | gnulib-800920c4b37502e59927464c05c9ca65db0390e3.tar.gz |
execute, spawn-pipe: Fix memory leak on native Windows.
* lib/windows-spawn.h (prepare_spawn): Add a second parameter.
* lib/windows-spawn.c: Don't include xalloc.h.
(quoted_arg_length, quoted_arg_string): New functions, extracted from
prepare_spawn.
(prepare_spawn): Use malloc instead of XNMALLOC. Allocate memory for all
elements of *new_argv together.
* modules/windows-spawn (Depends-on): Remove xalloc. Add malloc-posix.
* lib/os2-spawn.h (prepare_spawn): Add a second parameter.
* lib/os2-spawn.c: Don't include xalloc.h.
(prepare_spawn): Use malloc instead of XNMALLOC. Allocate memory for all
elements of *new_argv together.
* lib/execute.c: Include xalloc.h.
(execute): Check return value of prepare_spawn. Free the memory
allocated by prepare_spawn.
* modules/execute (Depends-on): Add xalloc-die.
* lib/spawn-pipe.c: Include xalloc.h.
(create_pipe): Check return value of prepare_spawn. Free the memory
allocated by prepare_spawn.
* modules/spawn-pipe (Depends-on): Add xalloc-die.
Diffstat (limited to 'modules/execute')
-rw-r--r-- | modules/execute | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/execute b/modules/execute index cb04003288..90a7b89c3c 100644 --- a/modules/execute +++ b/modules/execute @@ -32,6 +32,7 @@ stdlib unistd wait-process windows-spawn +xalloc-die configure.ac: gl_EXECUTE |