mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
[3.9] bpo-40998: Fix a refleak in create_filter() (GH-23365) (GH-23369)
(cherry picked from commit d1e38d4023
)
This commit is contained in:
parent
c53c3f4000
commit
35bf8ea7be
1 changed files with 5 additions and 2 deletions
|
@ -69,11 +69,14 @@ create_filter(PyObject *category, _Py_Identifier *id, const char *modname)
|
|||
}
|
||||
} else {
|
||||
modname_obj = Py_None;
|
||||
Py_INCREF(modname_obj);
|
||||
}
|
||||
|
||||
/* This assumes the line number is zero for now. */
|
||||
return PyTuple_Pack(5, action_str, Py_None,
|
||||
category, modname_obj, _PyLong_Zero);
|
||||
PyObject *filter = PyTuple_Pack(5, action_str, Py_None,
|
||||
category, modname_obj, _PyLong_Zero);
|
||||
Py_DECREF(modname_obj);
|
||||
return filter;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue