File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,6 +120,10 @@ test_dict_inner(int count)
120120
121121 for (i = 0 ; i < count ; i ++ ) {
122122 v = PyLong_FromLong (i );
123+ if (v == NULL ) {
124+ Py_DECREF (v );
125+ return -1 ;
126+ }
123127 if (PyDict_SetItem (dict , v , v ) < 0 ) {
124128 Py_DECREF (v );
125129 return -1 ;
@@ -1642,6 +1646,8 @@ test_long_numbits(PyObject *self)
16421646
16431647 for (i = 0 ; i < Py_ARRAY_LENGTH (testcases ); ++ i ) {
16441648 PyObject * plong = PyLong_FromLong (testcases [i ].input );
1649+ if (plong == NULL )
1650+ return NULL ;
16451651 size_t nbits = _PyLong_NumBits (plong );
16461652 int sign = _PyLong_Sign (plong );
16471653
@@ -2234,7 +2240,7 @@ profile_int(PyObject *self, PyObject* args)
22342240 gettimeofday (& start , NULL );
22352241 for (i = 0 ; i < 10000000 ; i ++ ) {
22362242 result = PyNumber_Add (op1 , op1 );
2237- Py_DECREF (result );
2243+ Py_XDECREF (result );
22382244 }
22392245 gettimeofday (& stop , NULL );
22402246 Py_DECREF (op1 );
You can’t perform that action at this time.
0 commit comments