Commit 538ba2af authored by Antoine Pitrou's avatar Antoine Pitrou

Fix a refleak

parent de3c73b5
...@@ -2782,10 +2782,11 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals, ...@@ -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;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment