File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -2059,21 +2059,21 @@ PySequence_Tuple(PyObject *v)
2059
2059
return NULL ;
2060
2060
2061
2061
PyObject * temp = PyList_New (0 );
2062
- if (temp == NULL )
2063
- goto Fail ;
2062
+ if (temp == NULL ) {
2063
+ Py_DECREF (it );
2064
+ return NULL ;
2065
+ }
2064
2066
2065
2067
/* Fill the temporary list. */
2066
2068
for (;;) {
2067
2069
PyObject * item = PyIter_Next (it );
2068
2070
if (item == NULL ) {
2069
2071
if (PyErr_Occurred ()) {
2070
- Py_DECREF (temp );
2071
2072
goto Fail ;
2072
2073
}
2073
2074
break ;
2074
2075
}
2075
2076
if (_PyList_AppendTakeRef ((PyListObject * )temp , item )) {
2076
- Py_DECREF (temp );
2077
2077
goto Fail ;
2078
2078
}
2079
2079
}
@@ -2083,6 +2083,7 @@ PySequence_Tuple(PyObject *v)
2083
2083
return result ;
2084
2084
2085
2085
Fail :
2086
+ Py_DECREF (temp );
2086
2087
Py_DECREF (it );
2087
2088
return NULL ;
2088
2089
}
Original file line number Diff line number Diff line change @@ -3186,7 +3186,7 @@ _PyList_AsTupleTakeItems(PyObject *v)
3186
3186
Py_ssize_t size ;
3187
3187
PyObject * * items ;
3188
3188
Py_BEGIN_CRITICAL_SECTION (self );
3189
- size = Py_SIZE (v );
3189
+ size = PyList_GET_SIZE (v );
3190
3190
items = self -> ob_item ;
3191
3191
Py_SET_SIZE (v , 0 );
3192
3192
self -> ob_item = NULL ;
You can’t perform that action at this time.
0 commit comments