[Python-checkins] r52163 - python/branches/release24-maint/Modules/posixmodule.c

andrew.kuchling python-checkins at python.org
Thu Oct 5 19:24:09 CEST 2006


Author: andrew.kuchling
Date: Thu Oct  5 19:24:08 2006
New Revision: 52163

Modified:
   python/branches/release24-maint/Modules/posixmodule.c
Log:
[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



Modified: python/branches/release24-maint/Modules/posixmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/posixmodule.c	(original)
+++ python/branches/release24-maint/Modules/posixmodule.c	Thu Oct  5 19:24:08 2006
@@ -825,6 +825,8 @@
 #else
 	ival = PyInt_FromLong((long)sec);
 #endif
+	if (!ival)
+		return;
 	if (_stat_float_times) {
 		fval = PyFloat_FromDouble(sec + 1e-9*nsec);
 	} else {


More information about the Python-checkins mailing list