diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-01-24 20:06:02 +0000 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-01-24 20:06:02 +0000 |
commit | 4bebbe54b373b0c8150e649bdd7ff5e6046f3cd8 (patch) | |
tree | 681d105f4276454a1dd74dab04921c6c595dac3e | |
parent | dd5728ff308dd89fcf52935f5daa1696393dbd4d (diff) | |
download | psutil-4bebbe54b373b0c8150e649bdd7ff5e6046f3cd8.tar.gz |
fix memleak
-rw-r--r-- | psutil/arch/freebsd/sys_socks.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/psutil/arch/freebsd/sys_socks.c b/psutil/arch/freebsd/sys_socks.c index c4edfcea..0946f761 100644 --- a/psutil/arch/freebsd/sys_socks.c +++ b/psutil/arch/freebsd/sys_socks.c @@ -219,7 +219,8 @@ int psutil_gather_inet(int proto, PyObject *py_retlist) { goto error; if (PyList_Append(py_retlist, py_tuple)) goto error; - Py_DECREF(py_tuple); + Py_CLEAR(py_tuple); + Py_CLEAR(py_pid); } free(buf); @@ -291,7 +292,7 @@ int psutil_gather_unix(int proto, PyObject *py_retlist) { } while (xug->xug_gen != exug->xug_gen && retry--); for (;;) { - struct xfile *xf; + struct xfile *xf; xug = (struct xunpgen *)(void *)((char *)xug + xug->xug_len); if (xug >= exug) |