From: Neal Norwitz Date: Sat, 12 Aug 2006 01:50:38 +0000 (+0000) Subject: If _stat_float_times is false, we will try to INCREF ival which could be NULL. X-Git-Tag: v2.5c1~80 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0a81afb10f06e688093e28d5e8f42993cef9020;p=python 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 d968b6c4cd..5c67be6dc0 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1121,6 +1121,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 {