8000 gh-117953: Fix Refleaks Introduced by gh-118194 (gh-118250) · python/cpython@85ec1c2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 85ec1c2

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 345e1e0 commit 85ec1c2

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
@@ -169,9 +169,13 @@ _Py_ext_module_loader_info_init_from_spec(
169169
}
170170
PyObject *filename = PyObject_GetAttrString(spec, "origin");
171171
if (filename == NULL) {
172+
Py_DECREF(name);
172173
return -1;
173174
}
174-
return _Py_ext_module_loader_info_init(p_info, name, filename);
175+
int err = _Py_ext_module_loader_info_init(p_info, name, filename);
176+
Py_DECREF(name);
177+
Py_DECREF(filename);
178+
return err;
175179
}
176180

177181

0 commit comments

Comments
 (0)
110
0