changeset: 75317:b4321f93e3f2 branch: 3.2 parent: 75312:b52fbbcdc8e6 user: Stefan Krah date: Mon Feb 27 17:34:17 2012 +0100 files: Modules/timemodule.c description: Issue #14125: backport refleak fix (d4adbf908983). diff -r b52fbbcdc8e6 -r b4321f93e3f2 Modules/timemodule.c --- a/Modules/timemodule.c Mon Feb 27 11:56:29 2012 +0000 +++ b/Modules/timemodule.c Mon Feb 27 17:34:17 2012 +0100 @@ -504,7 +504,7 @@ fmt = PyBytes_AS_STRING(format); #endif -#if defined(MS_WINDOWS) +#if defined(MS_WINDOWS) && !defined(HAVE_WCSFTIME) /* check that the format string contains only valid directives */ for(outbuf = strchr(fmt, '%'); outbuf != NULL; @@ -516,7 +516,8 @@ !strchr("aAbBcdHIjmMpSUwWxXyYzZ%", outbuf[1])) { PyErr_SetString(PyExc_ValueError, "Invalid format string"); - return 0; + Py_DECREF(format); + return NULL; } } #endif

AltStyle によって変換されたページ (->オリジナル) /