mirror of
https://github.com/python/cpython.git
synced 2025-11-09 22:16:39 +00:00
Add missing check of PyDict_SetItem()'s return value
CID 486659
This commit is contained in:
parent
26532f7519
commit
97cb67b9ca
1 changed files with 4 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue