]> granicus.if.org Git - python/commitdiff
If _stat_float_times is false, we will try to INCREF ival which could be NULL.
authorNeal Norwitz <nnorwitz@gmail.com>
Sat, 12 Aug 2006 01:50:38 +0000 (01:50 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sat, 12 Aug 2006 01:50:38 +0000 (01:50 +0000)
Return early in that case.  The caller checks for PyErr_Occurred so this
should be ok.

Klocwork #297

Modules/posixmodule.c

index d968b6c4cd4df0e015411edc8745b02eb5bb8728..5c67be6dc08e4df0e308ad8b9a4769b0badb2ae0 100644 (file)
@@ -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 {