diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-04-16 21:52:45 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-04-16 21:52:45 +0200 |
commit | 92e8b174fc2d8893cd6c710f4e4af397425aee73 (patch) | |
tree | 234ff2e3f292adb05d93037dec696a7ae8398854 /Python/import.c | |
parent | fc0652d5a3e7b85935fd1ccdda1372a555aeb36d (diff) | |
download | cpython-92e8b174fc2d8893cd6c710f4e4af397425aee73.tar.gz |
Fix a refleak
Diffstat (limited to 'Python/import.c')
-rw-r--r-- | Python/import.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/import.c b/Python/import.c index bd0d18ac31..a71bc3756d 100644 --- a/Python/import.c +++ b/Python/import.c @@ -2782,10 +2782,11 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals, } base = PyUnicode_Substring(package, 0, last_dot); if (PyUnicode_GET_LENGTH(name) > 0) { - PyObject *borrowed_dot = NULL; - PyObject *seq = PyTuple_Pack(2, base, name); + PyObject *borrowed_dot, *seq = NULL; borrowed_dot = _PyUnicode_FromId(&single_dot); + seq = PyTuple_Pack(2, base, name); + Py_DECREF(base); if (borrowed_dot == NULL || seq == NULL) { goto error; } |