Issue #24583: Fix refcount leak.

This commit is contained in:
Raymond Hettinger 2015-07-20 01:23:32 -04:00
parent cfe5b6ca04
commit 482c05cbb5

View file

@ -223,9 +223,13 @@ _set_add_entry(PySetObject *so, PyObject *key, Py_hash_t hash)
entry->hash = hash;
if ((size_t)so->fill*3 < mask*2)
return 0;
return set_table_resize(so, so->used);
if (!set_table_resize(so, so->used))
return 0;
Py_INCREF(key);
return -1;
found_active:
Py_DECREF(key);
return 0;
}