From 9eff723d0d1618628055b2806942a0488462768a Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Sun, 4 Jun 2017 20:52:27 +0300 Subject: [PATCH] [3.6] bpo-30567: Fix refleak in sys.getwindowsversion (GH-1940) (cherry picked from commit 48fb766) --- Python/sysmodule.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 99e6b5ea018ea1..b09268b0e53854 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -985,10 +985,10 @@ sys_getwindowsversion(PyObject *self) } PyMem_RawFree(verblock); } - PyStructSequence_SET_ITEM(version, pos++, PyTuple_Pack(3, - PyLong_FromLong(realMajor), - PyLong_FromLong(realMinor), - PyLong_FromLong(realBuild) + PyStructSequence_SET_ITEM(version, pos++, Py_BuildValue("(kkk)", + realMajor, + realMinor, + realBuild )); if (PyErr_Occurred()) {