diff options
Diffstat (limited to 'psutil/arch/windows/socks.c')
-rw-r--r-- | psutil/arch/windows/socks.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/psutil/arch/windows/socks.c b/psutil/arch/windows/socks.c index 0da0852b..baacd6c4 100644 --- a/psutil/arch/windows/socks.c +++ b/psutil/arch/windows/socks.c @@ -126,7 +126,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { CHAR addressBufferLocal[65]; CHAR addressBufferRemote[65]; - PyObject *py_retlist; + PyObject *py_retlist = NULL; PyObject *py_conn_tuple = NULL; PyObject *py_af_filter = NULL; PyObject *py_type_filter = NULL; @@ -137,9 +137,10 @@ psutil_net_connections(PyObject *self, PyObject *args) { PyObject *_SOCK_STREAM = PyLong_FromLong((long)SOCK_STREAM); PyObject *_SOCK_DGRAM = PyLong_FromLong((long)SOCK_DGRAM); - // Import some functions. - if (! PyArg_ParseTuple(args, "lOO", &pid, &py_af_filter, &py_type_filter)) + if (! PyArg_ParseTuple(args, "O&OO", Py_PidConverter, &pid, &py_af_filter, + &py_type_filter)) { goto error; + } if (!PySequence_Check(py_af_filter) || !PySequence_Check(py_type_filter)) { psutil_conn_decref_objs(); |