Skip to content

Commit 9508b74

Browse files
gh-117953: Fix Refleaks Introduced by gh-118194 (gh-118250)
A couple of refleaks slipped through in gh-118194. This takes care of them. (AKA _Py_ext_module_loader_info_init() does not steal references.)
1 parent 6f7a862 commit 9508b74

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Python/importdl.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,13 @@ _Py_ext_module_loader_info_init_from_spec(
195195
}
196196
PyObject *filename = PyObject_GetAttrString(spec, "origin");
197197
if (filename == NULL) {
198+
Py_DECREF(name);
198199
return -1;
199200
}
200-
return _Py_ext_module_loader_info_init(p_info, name, filename);
201+
int err = _Py_ext_module_loader_info_init(p_info, name, filename);
202+
Py_DECREF(name);
203+
Py_DECREF(filename);
204+
return err;
201205
}
202206

203207

0 commit comments

Comments
 (0)