]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-129813, PEP 782: Fix refleak in sock_recvfrom() (GH-139151)
authorVictor Stinner <vstinner@python.org>
Fri, 19 Sep 2025 09:30:11 +0000 (10:30 +0100)
committerGitHub <noreply@github.com>
Fri, 19 Sep 2025 09:30:11 +0000 (09:30 +0000)
Modules/socketmodule.c

index 8be06bddf3d08aabbffce74bf89ad8c082f3893c..92e6be68192dcc801ef07177623e0e5d284b267d 100644 (file)
@@ -4191,6 +4191,7 @@ sock_recvfrom(PyObject *self, PyObject *args)
     }
 
     ret = PyTuple_Pack(2, buf, addr);
+    Py_DECREF(buf);
 
 finally:
     Py_XDECREF(addr);