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.)
This commit is contained in:
Eric Snow 2024-04-24 15:23:45 -06:00 committed by GitHub
parent 345e1e04ec
commit 85ec1c2dc6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}