Kaydet (Commit) e9ddbf65 authored tarafından Victor Stinner's avatar Victor Stinner

Issue #11630, issue #3080: Fix refleak introduced by ef2b6305d395

üst 0a4edd54
......@@ -3705,12 +3705,15 @@ imp_load_dynamic(PyObject *self, PyObject *args)
return NULL;
if (fob != NULL) {
fp = get_file(NULL, fob, "r");
if (fp == NULL)
if (fp == NULL) {
Py_DECREF(pathname);
return NULL;
}
}
else
fp = NULL;
mod = _PyImport_LoadDynamicModule(name, pathname, fp);
Py_DECREF(pathname);
if (fp)
fclose(fp);
return mod;
......
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