Skip to content

Commit 7251169

Browse files
authored
Fix reading from uninitialized pid
1 parent d070f06 commit 7251169

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Modules/_posixsubprocess.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,7 @@ subprocess_fork_exec_impl(PyObject *module, PyObject *process_args,
873873
PyObject *converted_args = NULL, *fast_args = NULL;
874874
PyObject *preexec_fn_args_tuple = NULL;
875875
gid_t *extra_groups = NULL;
876+
pid_t pid = -1;
876877
PyObject *cwd_obj2 = NULL;
877878
const char *cwd = NULL;
878879
int need_to_reenable_gc = 0;
@@ -1066,7 +1067,7 @@ subprocess_fork_exec_impl(PyObject *module, PyObject *process_args,
10661067
}
10671068
#endif
10681069

1069-
pid_t pid = do_fork_exec(exec_array, argv, envp, cwd,
1070+
pid = do_fork_exec(exec_array, argv, envp, cwd,
10701071
p2cread, p2cwrite, c2pread, c2pwrite,
10711072
errread, errwrite, errpipe_read, errpipe_write,
10721073
close_fds, restore_signals, call_setsid, pgid_to_set,

0 commit comments

Comments
 (0)