282 */
283 PyObject* pyewf_file_close(
284 pyewf_file_t *pyewf_file )
285 {
286 #if defined( HAVE_V2_API )
287 if( libewf_handle_close(
288 pyewf_file->handle,
289 NULL ) != 0 )
290 {
291 return( PyErr_Format(
292 PyExc_IOError,
293 "libewf_handle_close failed to close file(s)" ) );
294 }
295 if( libewf_handle_free(
296 &( pyewf_file->handle ),
297 NULL ) != 1 )
298 {
299 return( PyErr_Format(
300 PyExc_IOError,
301 "libewf_handle_free failed to free handle" ) );
302 }
303 #else
304 if( libewf_close(
when considering value == (int)0 from pyewf_file.c:304
taking False path
ob_refcnt is now refs: 0 + N where N >= 1
305 pyewf_file->handle ) != 0 )
306 {
307 return( PyErr_Format(
308 PyExc_IOError,
309 "libewf_close failed to close file(s)" ) );
310 }
311 #endif
312 return( Py_None );
313 }
ob_refcnt of return value is 1 too low
was expecting final ob_refcnt to be N + 1 (for some unknown N)
due to object being referenced by: return value
but final ob_refcnt is N + 0
consider using "Py_RETURN_NONE;"