Check return value of PyList_Append() in Py_Main(). CID 1353200

This commit is contained in:
Christian Heimes 2016-09-09 00:08:35 +02:00
parent 301edfa579
commit 275270772e
1 changed files with 2 additions and 1 deletions

View File

@ -482,7 +482,8 @@ Py_Main(int argc, wchar_t **argv)
warning_option = PyUnicode_FromWideChar(_PyOS_optarg, -1);
if (warning_option == NULL)
Py_FatalError("failure in handling of -W argument");
PyList_Append(warning_options, warning_option);
if (PyList_Append(warning_options, warning_option) == -1)
Py_FatalError("failure in handling of -W argument");
Py_DECREF(warning_option);
break;