Skip to content

Commit

Permalink
gh-117953: Fix Refleaks Introduced by gh-118194 (gh-118250)
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
ericsnowcurrently committed Apr 24, 2024
1 parent 6f7a862 commit 9508b74
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Python/importdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,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;
}


Expand Down

0 comments on commit 9508b74

Please sign in to comment.