diff -r ce6a6cc3765d Modules/posixmodule.c --- a/Modules/posixmodule.c Tue Dec 20 22:52:33 2016 +0800 +++ b/Modules/posixmodule.c Wed Dec 21 18:24:26 2016 +0800 @@ -1012,6 +1012,7 @@ length ); if (!wo) { + Py_DECREF(bytes); goto exit; } @@ -1019,14 +1020,17 @@ Py_DECREF(wo); if (!wide) { + Py_DECREF(bytes); goto exit; } if (length > 32767) { FORMAT_EXCEPTION(PyExc_ValueError, "%s too long for Windows"); + Py_DECREF(bytes); goto exit; } if (wcslen(wide) != length) { FORMAT_EXCEPTION(PyExc_ValueError, "embedded null character in %s"); + Py_DECREF(bytes); goto exit; } path->wide = wide;