From: Segev Finer Date: Sun, 4 Jun 2017 17:52:27 +0000 (+0300) Subject: bpo-30567: Fix refleak in sys.getwindowsversion (#1940) X-Git-Tag: v3.7.0a1~691 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48fb766f70d9ca9d5934cbddbe8d8e7972cb6343;p=thirdparty%2FPython%2Fcpython.git bpo-30567: Fix refleak in sys.getwindowsversion (#1940) --- diff --git a/Python/sysmodule.c b/Python/sysmodule.c index a7b7508f4a1b..741060189c83 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -973,10 +973,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()) {