]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[Backport r51223 | neal.norwitz]
authorAndrew M. Kuchling <amk@amk.ca>
Thu, 5 Oct 2006 17:24:08 +0000 (17:24 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Thu, 5 Oct 2006 17:24:08 +0000 (17:24 +0000)
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

Modules/posixmodule.c

index 10fdf719b2244cee50ee517c669479c1e0de9eac..74ab2866e985d7a6f66c1c99528b133855534027 100644 (file)
@@ -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 {