diff options
author | Christian Heimes <christian@cheimes.de> | 2013-07-20 13:01:26 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-07-20 13:01:26 (GMT) |
commit | 97cb67b9ca1d3e36dcaabb3879380c01820e16a6 (patch) | |
tree | 7f70337b8c89b01e45fcd25703819e877f405113 | |
parent | 26532f7519b9b7764dd046acab49d5fc5dbcd94d (diff) | |
download | cpython-97cb67b9ca1d3e36dcaabb3879380c01820e16a6.zip cpython-97cb67b9ca1d3e36dcaabb3879380c01820e16a6.tar.gz cpython-97cb67b9ca1d3e36dcaabb3879380c01820e16a6.tar.bz2 |
Add missing check of PyDict_SetItem()'s return value
CID 486659
-rw-r--r-- | Modules/_testcapimodule.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 2f43813..ab10faa 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -120,7 +120,10 @@ test_dict_inner(int count) for (i = 0; i < count; 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); } |