summaryrefslogtreecommitdiffstats
path: root/Python/importdl.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/importdl.c')
-rw-r--r--Python/importdl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/importdl.c b/Python/importdl.c
index 6537024..f2ad95f 100644
--- a/Python/importdl.c
+++ b/Python/importdl.c
@@ -169,9 +169,13 @@ _Py_ext_module_loader_info_init_from_spec(
}
PyObject *filename = PyObject_GetAttrString(spec, "origin");
if (filename == NULL) {
+ Py_DECREF(name);
return -1;
}
- return _Py_ext_module_loader_info_init(p_info, name, filename);
+ int err = _Py_ext_module_loader_info_init(p_info, name, filename);
+ Py_DECREF(name);
+ Py_DECREF(filename);
+ return err;
}