contains only the changes related to leaking the copy variable.
importer = get_path_importer(path_importer_cache,
path_hooks, v);
- if (importer == NULL)
+ if (importer == NULL) {
+ Py_XDECREF(copy);
return NULL;
+ }
/* Note: importer is a borrowed reference */
if (importer == Py_False) {
/* Cached as not being a valid dir. */
loader = PyObject_CallMethod(importer,
"find_module",
"s", fullname);
+ Py_XDECREF(copy);
if (loader == NULL)
return NULL; /* error */
if (loader != Py_None) {
return &importhookdescr;
}
Py_DECREF(loader);
- Py_XDECREF(copy);
continue;
}
}