File tree Expand file tree Collapse file tree 1 file changed +0
-9
lines changed Expand file tree Collapse file tree 1 file changed +0
-9
lines changed Original file line number Diff line number Diff line change @@ -180,14 +180,12 @@ static void _CallPythonObject(void *mem,
180
180
PyObject * cnv = cnvs [i ];
181
181
StgDictObject * dict ;
182
182
183
- Py_INCREF (cnv );
184
183
dict = PyType_stgdict (cnv );
185
184
186
185
if (dict && dict -> getfunc && !_ctypes_simple_instance (cnv )) {
187
186
PyObject * v = dict -> getfunc (* pArgs , dict -> size );
188
187
if (!v ) {
189
188
PrintError ("create argument %zd:\n" , i );
190
- Py_DECREF (cnv );
191
189
goto Done ;
192
190
}
193
191
args [i ] = v ;
@@ -206,7 +204,6 @@ static void _CallPythonObject(void *mem,
206
204
}
207
205
if (!CDataObject_Check (obj )) {
208
206
Py_DECREF (obj );
209
- Py_DECREF (cnv );
210
207
PrintError ("unexpected result of create argument %zd:\n" , i );
211
208
goto Done ;
212
209
}
@@ -219,10 +216,8 @@ static void _CallPythonObject(void *mem,
219
216
PyErr_SetString (PyExc_TypeError ,
220
217
"cannot build parameter" );
221
218
PrintError ("Parsing argument %zd\n" , i );
222
- Py_DECREF (cnv );
223
219
goto Done ;
224
220
}
225
- Py_DECREF (cnv );
226
221
/* XXX error handling! */
227
222
pArgs ++ ;
228
223
}
@@ -391,11 +386,7 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
391
386
PyObject * * cnvs = PySequence_Fast_ITEMS (converters );
392
387
for (i = 0 ; i < nArgs ; ++ i ) {
393
388
PyObject * cnv = cnvs [i ];
394
- if (cnv == NULL )
395
- goto error ;
396
- Py_INCREF (cnv );
397
389
p -> atypes [i ] = _ctypes_get_ffi_type (cnv );
398
- Py_DECREF (cnv );
399
390
}
400
391
p -> atypes [i ] = NULL ;
401
392
You can’t perform that action at this time.
0 commit comments