File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -1133,13 +1133,25 @@ Insert a new item x into the array before position i.");
11331133static PyObject *
11341134array_buffer_info (arrayobject * self , PyObject * unused )
11351135{
1136- PyObject * retval = NULL ;
1136+ PyObject * retval = NULL , * v ;
1137+
11371138 retval = PyTuple_New (2 );
11381139 if (!retval )
11391140 return NULL ;
11401141
1141- PyTuple_SET_ITEM (retval , 0 , PyLong_FromVoidPtr (self -> ob_item ));
1142- PyTuple_SET_ITEM (retval , 1 , PyLong_FromLong ((long )(Py_SIZE (self ))));
1142+ v = PyLong_FromVoidPtr (self -> ob_item );
1143+ if (v == NULL ) {
1144+ Py_DECREF (retval );
1145+ return NULL ;
1146+ }
1147+ PyTuple_SET_ITEM (retval , 0 , v );
1148+
1149+ v = PyLong_FromLong ((long )(Py_SIZE (self )));
1150+ if (v == NULL ) {
1151+ Py_DECREF (retval );
1152+ return NULL ;
1153+ }
1154+ PyTuple_SET_ITEM (retval , 1 , v );
11431155
11441156 return retval ;
11451157}
You can’t perform that action at this time.
0 commit comments