Issue #20437: Fixed 22 potential bugs when deleting objects references.

This commit is contained in:
Serhiy Storchaka 2014-02-09 13:46:20 +02:00
commit dfe98a102e
15 changed files with 34 additions and 63 deletions

View file

@ -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)