mirror of
https://github.com/python/cpython.git
synced 2025-10-27 11:44:39 +00:00
gh-139748: fix leaks in AC error paths when using unicode FS-based converters (#139765)
This commit is contained in:
parent
570d17259f
commit
b04a57deef
14 changed files with 88 additions and 46 deletions
|
|
@ -7278,7 +7278,7 @@ Returns a list of network interface information (index, name) tuples.");
|
|||
|
||||
/*[clinic input]
|
||||
_socket.if_nametoindex
|
||||
oname: object(converter="PyUnicode_FSConverter")
|
||||
oname: unicode_fs_encoded
|
||||
/
|
||||
|
||||
Returns the interface index corresponding to the interface name if_name.
|
||||
|
|
@ -7286,7 +7286,7 @@ Returns the interface index corresponding to the interface name if_name.
|
|||
|
||||
static PyObject *
|
||||
_socket_if_nametoindex_impl(PyObject *module, PyObject *oname)
|
||||
/*[clinic end generated code: output=289a411614f30244 input=01e0f1205307fb77]*/
|
||||
/*[clinic end generated code: output=289a411614f30244 input=6125dc20683560cf]*/
|
||||
{
|
||||
#ifdef MS_WINDOWS
|
||||
NET_IFINDEX index;
|
||||
|
|
@ -7295,7 +7295,6 @@ _socket_if_nametoindex_impl(PyObject *module, PyObject *oname)
|
|||
#endif
|
||||
|
||||
index = if_nametoindex(PyBytes_AS_STRING(oname));
|
||||
Py_DECREF(oname);
|
||||
if (index == 0) {
|
||||
/* if_nametoindex() doesn't set errno */
|
||||
PyErr_SetString(PyExc_OSError, "no interface with this name");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue