File: alsaaudio.c
Function: alsamixer_polldescriptors
Error: ob_refcnt of '*result' is 1 too high
1914 static PyObject *
1915 alsamixer_polldescriptors(alsamixer_t *self, PyObject *args) 
1916 {
1917     int i, count, rc;
1918     PyObject *result;
1919     struct pollfd *fds;
1920 
1921     if (!PyArg_ParseTuple(args,":polldescriptors")) 
when PyArg_ParseTuple() succeeds
taking False path
1922         return NULL;
1923     
1924     if (!self->handle) 
when treating unknown struct snd_mixer_t * from alsaaudio.c:1924 as non-NULL
taking False path
1925     {
1926         PyErr_SetString(ALSAAudioError, "Mixer is closed");
1927         return NULL;
1928     }
1929     
1930     count = snd_mixer_poll_descriptors_count(self->handle);
1931     if (count < 0)
when considering range: 0 <= value <= 0x7fffffff
taking False path
1932     {
1933         PyErr_SetString(ALSAAudioError,"Can't get poll descriptor count");
1934         return NULL;
1935     }
1936 
1937     fds = (struct pollfd*)calloc(count, sizeof(struct pollfd));
1938     if (!fds)
when treating unknown void * from alsaaudio.c:1937 as non-NULL
taking False path
1939     {
1940         PyErr_SetString(PyExc_MemoryError, "Out of memory");
1941         return NULL;
1942     }
1943 
1944     result = PyList_New(count);
when PyList_New() succeeds
PyListObject allocated at:     result = PyList_New(count);
ob_refcnt is now refs: 1 + N where N >= 0
1945     rc = snd_mixer_poll_descriptors(self->handle, fds, (unsigned int)count);
1946     if (rc != count)
when taking True path
1947     {
1948         PyErr_SetString(ALSAAudioError,"Can't get poll descriptors");
calling PyErr_SetString()
1949         return NULL;
1950     }
1951 
1952     for (i = 0; i < count; ++i)
1953     {
1954         PyList_SetItem(result, i, 
1955                        Py_BuildValue("II", fds[i].fd, fds[i].events));
1956     }
1957 
1958     return result;
1959 }
ob_refcnt of '*result' is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1

File: alsaaudio.c
Function: alsamixer_polldescriptors
Error: calling PyList_SetItem with NULL as argument 1 (result) at alsaaudio.c:1954
1914 static PyObject *
1915 alsamixer_polldescriptors(alsamixer_t *self, PyObject *args) 
1916 {
1917     int i, count, rc;
1918     PyObject *result;
1919     struct pollfd *fds;
1920 
1921     if (!PyArg_ParseTuple(args,":polldescriptors")) 
when PyArg_ParseTuple() succeeds
taking False path
1922         return NULL;
1923     
1924     if (!self->handle) 
when treating unknown struct snd_mixer_t * from alsaaudio.c:1924 as non-NULL
taking False path
1925     {
1926         PyErr_SetString(ALSAAudioError, "Mixer is closed");
1927         return NULL;
1928     }
1929     
1930     count = snd_mixer_poll_descriptors_count(self->handle);
1931     if (count < 0)
when considering range: 0 <= value <= 0x7fffffff
taking False path
1932     {
1933         PyErr_SetString(ALSAAudioError,"Can't get poll descriptor count");
1934         return NULL;
1935     }
1936 
1937     fds = (struct pollfd*)calloc(count, sizeof(struct pollfd));
1938     if (!fds)
when treating unknown void * from alsaaudio.c:1937 as non-NULL
taking False path
1939     {
1940         PyErr_SetString(PyExc_MemoryError, "Out of memory");
1941         return NULL;
1942     }
1943 
1944     result = PyList_New(count);
when PyList_New() fails
1945     rc = snd_mixer_poll_descriptors(self->handle, fds, (unsigned int)count);
1946     if (rc != count)
when taking False path
1947     {
1948         PyErr_SetString(ALSAAudioError,"Can't get poll descriptors");
1949         return NULL;
1950     }
1951 
1952     for (i = 0; i < count; ++i)
when considering range: 1 <= count <= 0x7fffffff
taking True path
1953     {
1954         PyList_SetItem(result, i, 
when Py_BuildValue() succeeds
calling PyList_SetItem with NULL as argument 1 (result) at alsaaudio.c:1954
PyList_SetItem() invokes Py_TYPE() on the pointer via the PyList_Check() macro, thus accessing (NULL)->ob_type
found 1 similar trace(s) to this
1955                        Py_BuildValue("II", fds[i].fd, fds[i].events));
1956     }
1957 
1958     return result;
1959 }