mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.14] gh-139748: fix leaks in AC error paths when using unicode FS-b… (#139789)
* [3.14] gh-139748: fix leaks in AC error paths when using unicode FS-based converters (GH-139765)
(cherry picked from commit b04a57deef)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
parent
077652b44f
commit
90cd009209
14 changed files with 88 additions and 46 deletions
7
Python/clinic/bltinmodule.c.h
generated
7
Python/clinic/bltinmodule.c.h
generated
|
|
@ -296,7 +296,7 @@ builtin_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj
|
|||
PyObject *argsbuf[7];
|
||||
Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3;
|
||||
PyObject *source;
|
||||
PyObject *filename;
|
||||
PyObject *filename = NULL;
|
||||
const char *mode;
|
||||
int flags = 0;
|
||||
int dont_inherit = 0;
|
||||
|
|
@ -367,6 +367,9 @@ skip_optional_kwonly:
|
|||
return_value = builtin_compile_impl(module, source, filename, mode, flags, dont_inherit, optimize, feature_version);
|
||||
|
||||
exit:
|
||||
/* Cleanup for filename */
|
||||
Py_XDECREF(filename);
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
|
|
@ -1274,4 +1277,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=cd5f80e3dc3082d5 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=b5d2231033c7591c input=a9049054013a1b77]*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue