]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-105673: Fix uninitialized warning in sysmodule.c (#105674)
authorNikita Sobolev <mail@sobolevn.me>
Mon, 12 Jun 2023 08:47:56 +0000 (11:47 +0300)
committerGitHub <noreply@github.com>
Mon, 12 Jun 2023 08:47:56 +0000 (08:47 +0000)
In sys_add_xoption(), 'value' may be uninitialized for some error paths.

Python/sysmodule.c

index 90e5e65dcf9f8df1172d07f10f66e141aba14271..f5d4711b0c2c9261dd87d525a4cc29ccb2a877ad 100644 (file)
@@ -3375,7 +3375,7 @@ err_occurred:
 static int
 sys_add_xoption(PyObject *opts, const wchar_t *s)
 {
-    PyObject *name, *value;
+    PyObject *name, *value = NULL;
 
     const wchar_t *name_end = wcschr(s, L'=');
     if (!name_end) {