From: Andrew M. Kuchling Date: Thu, 5 Oct 2006 17:24:08 +0000 (+0000) Subject: [Backport r51223 | neal.norwitz] X-Git-Tag: v2.4.4c1~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1ade3e925836a89e1ebacb74eb8e81d85190cd8;p=thirdparty%2FPython%2Fcpython.git [Backport r51223 | neal.norwitz] If _stat_float_times is false, we will try to INCREF ival which could be NULL. Return early in that case. The caller checks for PyErr_Occurred so this should be ok. Klocwork #297 --- diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 10fdf719b224..74ab2866e985 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -825,6 +825,8 @@ fill_time(PyObject *v, int index, time_t sec, unsigned long nsec) #else ival = PyInt_FromLong((long)sec); #endif + if (!ival) + return; if (_stat_float_times) { fval = PyFloat_FromDouble(sec + 1e-9*nsec); } else {