summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-02-09 11:46:20 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-02-09 11:46:20 (GMT)
commitdfe98a102ec8723d750f78ecda08a7adb9360eb1 (patch)
treef8aea8fb3d74be18ed67a2f4e0a355ad9beb42d8 /Python/import.c
parent2623c8c23cead505a78ec416072223552e94727e (diff)
parent505ff755d704c73ac613d3e8fed02c79c6ae555a (diff)
downloadcpython-dfe98a102ec8723d750f78ecda08a7adb9360eb1.zip
cpython-dfe98a102ec8723d750f78ecda08a7adb9360eb1.tar.gz
cpython-dfe98a102ec8723d750f78ecda08a7adb9360eb1.tar.bz2
Issue #20437: Fixed 22 potential bugs when deleting objects references.
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Python/import.c b/Python/import.c
index 001d745..d0115e4 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -349,8 +349,7 @@ _imp_release_lock_impl(PyModuleDef *module)
void
_PyImport_Fini(void)
{
- Py_XDECREF(extensions);
- extensions = NULL;
+ Py_CLEAR(extensions);
#ifdef WITH_THREAD
if (import_lock != NULL) {
PyThread_free_lock(import_lock);
@@ -598,8 +597,7 @@ _PyImport_FixupExtensionObject(PyObject *mod, PyObject *name,
/* Somebody already imported the module,
likely under a different name.
XXX this should really not happen. */
- Py_DECREF(def->m_base.m_copy);
- def->m_base.m_copy = NULL;
+ Py_CLEAR(def->m_base.m_copy);
}
dict = PyModule_GetDict(mod);
if (dict == NULL)