mirror of
https://github.com/python/cpython.git
synced 2025-12-09 10:37:17 +00:00
Fix a refleak
This commit is contained in:
parent
de3c73b57c
commit
538ba2afb5
1 changed files with 3 additions and 2 deletions
|
|
@ -2782,10 +2782,11 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
|
||||||
}
|
}
|
||||||
base = PyUnicode_Substring(package, 0, last_dot);
|
base = PyUnicode_Substring(package, 0, last_dot);
|
||||||
if (PyUnicode_GET_LENGTH(name) > 0) {
|
if (PyUnicode_GET_LENGTH(name) > 0) {
|
||||||
PyObject *borrowed_dot = NULL;
|
PyObject *borrowed_dot, *seq = NULL;
|
||||||
PyObject *seq = PyTuple_Pack(2, base, name);
|
|
||||||
|
|
||||||
borrowed_dot = _PyUnicode_FromId(&single_dot);
|
borrowed_dot = _PyUnicode_FromId(&single_dot);
|
||||||
|
seq = PyTuple_Pack(2, base, name);
|
||||||
|
Py_DECREF(base);
|
||||||
if (borrowed_dot == NULL || seq == NULL) {
|
if (borrowed_dot == NULL || seq == NULL) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue