Skip to content

Commit 2752707

Browse files
committed
Check return value of PyList_Append() in Py_Main(). CID 1353200
1 parent 301edfa commit 2752707

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Modules/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,8 @@ Py_Main(int argc, wchar_t **argv)
482482
warning_option = PyUnicode_FromWideChar(_PyOS_optarg, -1);
483483
if (warning_option == NULL)
484484
Py_FatalError("failure in handling of -W argument");
485-
PyList_Append(warning_options, warning_option);
485+
if (PyList_Append(warning_options, warning_option) == -1)
486+
Py_FatalError("failure in handling of -W argument");
486487
Py_DECREF(warning_option);
487488
break;
488489

0 commit comments

Comments
 (0)