mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
[3.8] bpo-38168: Fix a possbile refleak in setint() of mmapmodule.c (GH-16136) (GH-16174)
(cherry picked from commit 56a45142e7)
Co-authored-by: Hai Shi <shihai1992@gmail.com>
https://bugs.python.org/issue38168
Automerge-Triggered-By: @zhangyangyu
This commit is contained in:
parent
346b7c928b
commit
322309efe6
1 changed files with 2 additions and 1 deletions
|
|
@ -1468,7 +1468,8 @@ static void
|
|||
setint(PyObject *d, const char *name, long value)
|
||||
{
|
||||
PyObject *o = PyLong_FromLong(value);
|
||||
if (o && PyDict_SetItemString(d, name, o) == 0) {
|
||||
if (o) {
|
||||
PyDict_SetItemString(d, name, o);
|
||||
Py_DECREF(o);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue