Commit ef86368e authored by Christian Heimes's avatar Christian Heimes

Fix possible NULL pointer dereference in PyCurses_Start_Color()

CID 1058276
parents 5d7c1b1a a956e645
......@@ -2926,9 +2926,13 @@ PyCurses_Start_Color(PyObject *self)
if (code != ERR) {
initialisedcolors = TRUE;
c = PyLong_FromLong((long) COLORS);
if (c == NULL)
return NULL;
PyDict_SetItemString(ModDict, "COLORS", c);
Py_DECREF(c);
cp = PyLong_FromLong((long) COLOR_PAIRS);
if (cp == NULL)
return NULL;
PyDict_SetItemString(ModDict, "COLOR_PAIRS", cp);
Py_DECREF(cp);
Py_INCREF(Py_None);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment