]> granicus.if.org Git - python/commitdiff
Handle yet another potential failure in testcapi
authorChristian Heimes <christian@cheimes.de>
Fri, 26 Jul 2013 13:54:07 +0000 (15:54 +0200)
committerChristian Heimes <christian@cheimes.de>
Fri, 26 Jul 2013 13:54:07 +0000 (15:54 +0200)
CID 1058280

Modules/_testcapimodule.c

index c3563fb5d29ec35102ac1301ec0fb5ec905ecf13..86ef713fae47cd713f52c0ac5a1d304f9774edb2 100644 (file)
@@ -2249,6 +2249,8 @@ profile_int(PyObject *self, PyObject* args)
 
     /* Test 7: Perform medium int addition */
     op1 = PyLong_FromLong(1000);
+    if (op1 == NULL)
+        return NULL;
     gettimeofday(&start, NULL);
     for(i=0; i < 10000000; i++) {
         result = PyNumber_Add(op1, op1);