File: src/_portaudiomodule.c
Function: pa_get_default_input_device
Error: memory leak: ob_refcnt of new ref from call to Py_BuildValue is 1 too high
1404 static PyObject *
1405 pa_get_default_input_device(PyObject *self, PyObject *args)
1406 {
1407   PaDeviceIndex index;
1408 
1409   if (!PyArg_ParseTuple(args, ""))
when PyArg_ParseTuple() succeeds
taking False path
1410     return NULL;
1411 
1412   index = Pa_GetDefaultInputDevice();
1413   if (index == paNoDevice) {
when considering range: -0x80000000 <= value <= -2
taking False path
1414     PyErr_SetString(PyExc_IOError, "No Default Input Device Available");
1415     return NULL;
1416   } else if (index < 0) {
taking True path
1417 
1418 #ifdef VERBOSE
1419     fprintf(stderr, "An error occured while using the portaudio stream\n");
1420     fprintf(stderr, "Error number: %d\n", index);
1421     fprintf(stderr, "Error message: %s\n", Pa_GetErrorText(index));
1422 #endif
1423 
1424     PyErr_SetObject(PyExc_IOError,
when Py_BuildValue() succeeds
calling PyErr_SetObject()
new ref from call to Py_BuildValue was allocated at:     PyErr_SetObject(PyExc_IOError,
ob_refcnt is now refs: 1 owned
ob_refcnt is now refs: 1 owned, 1 borrowed
1425 		    Py_BuildValue("(s,i)",
1426 				  Pa_GetErrorText(index), index));
1427     return NULL;
memory leak: ob_refcnt of new ref from call to Py_BuildValue is 1 too high
was expecting final owned ob_refcnt of new ref from call to Py_BuildValue to be 0 since nothing references it but final ob_refcnt is refs: 1 owned, 1 borrowed
1428   }
1429 
1430   return PyLong_FromLong(index);
1431 }