mirror of https://github.com/python/cpython.git
Add missing check of PyDict_SetItem()'s return value
CID 486659
This commit is contained in:
parent
26532f7519
commit
97cb67b9ca
|
@ -120,7 +120,10 @@ test_dict_inner(int count)
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
v = PyLong_FromLong(i);
|
v = PyLong_FromLong(i);
|
||||||
PyDict_SetItem(dict, v, v);
|
if (PyDict_SetItem(dict, v, v) < 0) {
|
||||||
|
Py_DECREF(v);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
Py_DECREF(v);
|
Py_DECREF(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue