From: Serhiy Storchaka Date: Tue, 6 Jun 2017 16:23:21 +0000 (+0300) Subject: [3.5] bpo-30567: Fix refleak in sys.getwindowsversion (GH-1940) (#1971) X-Git-Tag: v3.5.4rc1~107 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86f8f1f05cd5822b4a4031b90cfdbe5fa1b1159e;p=python [3.5] bpo-30567: Fix refleak in sys.getwindowsversion (GH-1940) (#1971) (cherry picked from commit 48fb766) --- diff --git a/Python/sysmodule.c b/Python/sysmodule.c index fc769ad1d8..d62bbf117d 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -897,10 +897,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()) {