From: Victor Stinner Date: Wed, 30 Oct 2013 17:55:24 +0000 (+0100) Subject: Issue #19437: Fix os.statvfs(), handle errors X-Git-Tag: v3.4.0b1~468 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f0a7bac20174f602280cf4edb70bb8fe7480e2b0;p=thirdparty%2FPython%2Fcpython.git Issue #19437: Fix os.statvfs(), handle errors --- diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index d5b5235a4d6e..789bf27bc4d1 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -9173,6 +9173,10 @@ _pystatvfs_fromstructstatvfs(struct statvfs st) { PyStructSequence_SET_ITEM(v, 8, PyLong_FromLong((long) st.f_flag)); PyStructSequence_SET_ITEM(v, 9, PyLong_FromLong((long) st.f_namemax)); #endif + if (PyErr_Occurred()) { + Py_DECREF(v); + return NULL; + } return v; }