From 01f3d2024447b3cbbd3c1863add42acd3d0cc7b5 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Wed, 17 Jul 2024 18:46:10 +0300 Subject: [PATCH] gh-121925: Fix uninitialized variables in `main.c` --- Modules/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Modules/main.c b/Modules/main.c index bd77558ea6412f..3c202c85c76dcc 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -264,8 +264,12 @@ static int pymain_start_pyrepl_no_main(void) { int res = 0; - PyObject *pyrepl, *console, *empty_tuple, *kwargs, *console_result; - pyrepl = PyImport_ImportModule("_pyrepl.main"); + PyObject *console = NULL; + PyObject *empty_tuple = NULL; + PyObject *kwargs = NULL; + PyObject *console_result = NULL; + + PyObject *pyrepl = PyImport_ImportModule("_pyrepl.main"); if (pyrepl == NULL) { fprintf(stderr, "Could not import _pyrepl.main\n"); res = pymain_exit_err_print();