summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-08-12 01:50:38 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-08-12 01:50:38 (GMT)
commite0a81afb10f06e688093e28d5e8f42993cef9020 (patch)
tree76ab4fa0629b131308cd16810de5c70f80fb0048 /Modules/posixmodule.c
parent6bf1a8fe8be5d9e5458657befc811e8461e769f5 (diff)
downloadcpython-e0a81afb10f06e688093e28d5e8f42993cef9020.zip
cpython-e0a81afb10f06e688093e28d5e8f42993cef9020.tar.gz
cpython-e0a81afb10f06e688093e28d5e8f42993cef9020.tar.bz2
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
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index d968b6c..5c67be6 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 {