_socket_socket_if_nametoindex(PySocketSockObject *self, PyObject *arg)
{
PyObject *return_value = NULL;
- PyObject *oname;
+ PyObject *oname = NULL;
if (!PyUnicode_FSConverter(arg, &oname)) {
goto exit;
return_value = _socket_socket_if_nametoindex_impl(self, oname);
exit:
+ /* Cleanup for oname */
+ Py_XDECREF(oname);
+
return return_value;
}
#ifndef _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF
#define _SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF
#endif /* !defined(_SOCKET_SOCKET_IF_NAMETOINDEX_METHODDEF) */
-/*[clinic end generated code: output=eb37b5d88a1e4661 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=2a58294cf2c87e33 input=a9049054013a1b77]*/
/*[clinic input]
_socket.socket.if_nametoindex
- oname: object(converter="PyUnicode_FSConverter")
+ oname: unicode_fs_encoded
/
Returns the interface index corresponding to the interface name if_name.
static PyObject *
_socket_socket_if_nametoindex_impl(PySocketSockObject *self, PyObject *oname)
-/*[clinic end generated code: output=f7fc00511a309a8e input=662688054482cd46]*/
+/*[clinic end generated code: output=f7fc00511a309a8e input=242c01253c533053]*/
{
#ifdef MS_WINDOWS
NET_IFINDEX index;