summaryrefslogtreecommitdiffstats
path: root/Objects/odictobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-10-20 15:21:48 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-10-20 15:21:48 (GMT)
commitd17427b7bd69644bbbd3ccb97dcb920ac50197a6 (patch)
tree79865c36992c157ffaa8a6022592f971f38ff58d /Objects/odictobject.c
parentae94062ae9f3dcfa6933360482dc8c5839c0cf98 (diff)
downloadcpython-d17427b7bd69644bbbd3ccb97dcb920ac50197a6.zip
cpython-d17427b7bd69644bbbd3ccb97dcb920ac50197a6.tar.gz
cpython-d17427b7bd69644bbbd3ccb97dcb920ac50197a6.tar.bz2
Issue #25410: Fixed a memory leak in OrderedDict in the case when key's hash
calculation fails.
Diffstat (limited to 'Objects/odictobject.c')
-rw-r--r--Objects/odictobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/odictobject.c b/Objects/odictobject.c
index 0044b32..a028884 100644
--- a/Objects/odictobject.c
+++ b/Objects/odictobject.c
@@ -648,11 +648,11 @@ _odict_add_new_node(PyODictObject *od, PyObject *key)
Py_ssize_t i;
_ODictNode *node;
- Py_INCREF(key);
hash = PyObject_Hash(key);
if (hash == -1)
return -1;
+ Py_INCREF(key);
i = _odict_get_index(od, key);
if (i < 0) {
if (!PyErr_Occurred())