File: alsaaudio.c
Function: alsacard_list
Error: ob_refcnt of '*result' is 1 too high
114 static PyObject *
115 alsacard_list(PyObject *self, PyObject *args) 
116 {
117     int rc;
118     int card = -1;
119     snd_ctl_card_info_t *info;
120     snd_ctl_t *handle;
121     PyObject *result = NULL;
122     
123     if (!PyArg_ParseTuple(args,":cards")) 
when PyArg_ParseTuple() succeeds
taking False path
124         return NULL;
125     
126     snd_ctl_card_info_alloca(&info);
127     result = PyList_New(0);
when PyList_New() succeeds
PyListObject allocated at:     result = PyList_New(0);
ob_refcnt is now refs: 1 + N where N >= 0
128     
129     for (rc = snd_card_next(&card); !rc && (card >= 0); 
when considering value == (int)0 from alsaaudio.c:129
taking True path
when taking True path
130          rc = snd_card_next(&card))
131     {
132         char name[32];
133         int err;
134         PyObject *item;        
135 
136         /* One would be tempted to think that snd_card_get_name returns a name
137            that is actually meaningful for any further operations.
138            
139            Not in ALSA land. Here we need the id, not the name */
140 
141         sprintf(name, "hw:%d", card);
142         if ((err = snd_ctl_open(&handle, name, 0)) < 0) {
when considering range: -0x80000000 <= value <= -1
taking True path
143             PyErr_SetString(ALSAAudioError,snd_strerror(err));
calling PyErr_SetString()
144             return NULL;
145         }
146         if ((err = snd_ctl_card_info(handle, info)) < 0) {
147             PyErr_SetString(ALSAAudioError,snd_strerror(err));
148             snd_ctl_close(handle);
149             Py_DECREF(result);
150             return NULL;
151         }
152        
153         item = PyUnicode_FromString(snd_ctl_card_info_get_id(info));
154         PyList_Append(result, item); 
155         Py_DECREF(item);
156         
157         snd_ctl_close(handle);
158     }
159     
160     return result;  
161 }
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: alsacard_list
Error: dereferencing NULL (item->ob_refcnt) at alsaaudio.c:155
114 static PyObject *
115 alsacard_list(PyObject *self, PyObject *args) 
116 {
117     int rc;
118     int card = -1;
119     snd_ctl_card_info_t *info;
120     snd_ctl_t *handle;
121     PyObject *result = NULL;
122     
123     if (!PyArg_ParseTuple(args,":cards")) 
when PyArg_ParseTuple() succeeds
taking False path
124         return NULL;
125     
126     snd_ctl_card_info_alloca(&info);
127     result = PyList_New(0);
when PyList_New() succeeds
128     
129     for (rc = snd_card_next(&card); !rc && (card >= 0); 
when considering value == (int)0 from alsaaudio.c:129
taking True path
when taking True path
130          rc = snd_card_next(&card))
131     {
132         char name[32];
133         int err;
134         PyObject *item;        
135 
136         /* One would be tempted to think that snd_card_get_name returns a name
137            that is actually meaningful for any further operations.
138            
139            Not in ALSA land. Here we need the id, not the name */
140 
141         sprintf(name, "hw:%d", card);
142         if ((err = snd_ctl_open(&handle, name, 0)) < 0) {
when considering range: 0 <= value <= 0x7fffffff
taking False path
143             PyErr_SetString(ALSAAudioError,snd_strerror(err));
144             return NULL;
145         }
146         if ((err = snd_ctl_card_info(handle, info)) < 0) {
when considering range: 0 <= value <= 0x7fffffff
taking False path
147             PyErr_SetString(ALSAAudioError,snd_strerror(err));
148             snd_ctl_close(handle);
149             Py_DECREF(result);
150             return NULL;
151         }
152        
153         item = PyUnicode_FromString(snd_ctl_card_info_get_id(info));
when PyUnicodeUCS4_FromString() fails
154         PyList_Append(result, item); 
returning -1 from PyList_Append() due to NULL item
155         Py_DECREF(item);
dereferencing NULL (item->ob_refcnt) at alsaaudio.c:155
156         
157         snd_ctl_close(handle);
158     }
159     
160     return result;  
161 }

File: alsaaudio.c
Function: alsacard_list
Error: dereferencing NULL (result->ob_refcnt) at alsaaudio.c:149
114 static PyObject *
115 alsacard_list(PyObject *self, PyObject *args) 
116 {
117     int rc;
118     int card = -1;
119     snd_ctl_card_info_t *info;
120     snd_ctl_t *handle;
121     PyObject *result = NULL;
122     
123     if (!PyArg_ParseTuple(args,":cards")) 
when PyArg_ParseTuple() succeeds
taking False path
124         return NULL;
125     
126     snd_ctl_card_info_alloca(&info);
127     result = PyList_New(0);
when PyList_New() fails
128     
129     for (rc = snd_card_next(&card); !rc && (card >= 0); 
when considering value == (int)0 from alsaaudio.c:129
taking True path
when taking True path
130          rc = snd_card_next(&card))
131     {
132         char name[32];
133         int err;
134         PyObject *item;        
135 
136         /* One would be tempted to think that snd_card_get_name returns a name
137            that is actually meaningful for any further operations.
138            
139            Not in ALSA land. Here we need the id, not the name */
140 
141         sprintf(name, "hw:%d", card);
142         if ((err = snd_ctl_open(&handle, name, 0)) < 0) {
when considering range: 0 <= value <= 0x7fffffff
taking False path
143             PyErr_SetString(ALSAAudioError,snd_strerror(err));
144             return NULL;
145         }
146         if ((err = snd_ctl_card_info(handle, info)) < 0) {
when considering range: -0x80000000 <= value <= -1
taking True path
147             PyErr_SetString(ALSAAudioError,snd_strerror(err));
calling PyErr_SetString()
148             snd_ctl_close(handle);
149             Py_DECREF(result);
dereferencing NULL (result->ob_refcnt) at alsaaudio.c:149
150             return NULL;
151         }
152        
153         item = PyUnicode_FromString(snd_ctl_card_info_get_id(info));
154         PyList_Append(result, item); 
155         Py_DECREF(item);
156         
157         snd_ctl_close(handle);
158     }
159     
160     return result;  
161 }

File: alsaaudio.c
Function: alsacard_list
Error: calling PyList_Append with NULL as argument 1 (result) at alsaaudio.c:154
114 static PyObject *
115 alsacard_list(PyObject *self, PyObject *args) 
116 {
117     int rc;
118     int card = -1;
119     snd_ctl_card_info_t *info;
120     snd_ctl_t *handle;
121     PyObject *result = NULL;
122     
123     if (!PyArg_ParseTuple(args,":cards")) 
when PyArg_ParseTuple() succeeds
taking False path
124         return NULL;
125     
126     snd_ctl_card_info_alloca(&info);
127     result = PyList_New(0);
when PyList_New() fails
128     
129     for (rc = snd_card_next(&card); !rc && (card >= 0); 
when considering value == (int)0 from alsaaudio.c:129
taking True path
when taking True path
130          rc = snd_card_next(&card))
131     {
132         char name[32];
133         int err;
134         PyObject *item;        
135 
136         /* One would be tempted to think that snd_card_get_name returns a name
137            that is actually meaningful for any further operations.
138            
139            Not in ALSA land. Here we need the id, not the name */
140 
141         sprintf(name, "hw:%d", card);
142         if ((err = snd_ctl_open(&handle, name, 0)) < 0) {
when considering range: 0 <= value <= 0x7fffffff
taking False path
143             PyErr_SetString(ALSAAudioError,snd_strerror(err));
144             return NULL;
145         }
146         if ((err = snd_ctl_card_info(handle, info)) < 0) {
when considering range: 0 <= value <= 0x7fffffff
taking False path
147             PyErr_SetString(ALSAAudioError,snd_strerror(err));
148             snd_ctl_close(handle);
149             Py_DECREF(result);
150             return NULL;
151         }
152        
153         item = PyUnicode_FromString(snd_ctl_card_info_get_id(info));
when PyUnicodeUCS4_FromString() succeeds
154         PyList_Append(result, item); 
calling PyList_Append with NULL as argument 1 (result) at alsaaudio.c:154
PyList_Append() invokes Py_TYPE() on the pointer via the PyList_Check() macro, thus accessing (NULL)->ob_type
found 1 similar trace(s) to this
155         Py_DECREF(item);
156         
157         snd_ctl_close(handle);
158     }
159     
160     return result;  
161 }