File: alsaaudio.c
Function: alsamixer_switchcap
Error: ob_refcnt of new ref from (unknown) PyUnicodeUCS4_FromString is 1 too high
1274 static PyObject *
1275 alsamixer_switchcap(alsamixer_t *self, PyObject *args) 
1276 {
1277     PyObject *result;
1278     PyObject *item;
1279 
1280     if (!PyArg_ParseTuple(args,":switchcap")) 
when PyArg_ParseTuple() succeeds
taking False path
1281         return NULL;
1282 
1283     if (!self->handle) 
when treating unknown struct snd_mixer_t * from alsaaudio.c:1283 as non-NULL
taking False path
1284     {
1285         PyErr_SetString(ALSAAudioError, "Mixer is closed");
1286         return NULL;
1287     }
1288 
1289     result = PyList_New(0);
when PyList_New() succeeds
1290     if (self->volume_cap&MIXER_CAP_SWITCH) 
when considering value == (int)0 from alsaaudio.c:1290
taking False path
1291     {
1292         item = PyUnicode_FromString("Mute");
1293         PyList_Append(result, item);
1294         Py_DECREF(item);
1295     }
1296     if (self->volume_cap&MIXER_CAP_SWITCH_JOINED) 
when considering value == (unsigned int)0 from alsaaudio.c:1296
taking False path
1297     {
1298         item = PyUnicode_FromString("Joined Mute");
1299         PyList_Append(result, item);
1300         Py_DECREF(item);
1301     }
1302     if (self->volume_cap&MIXER_CAP_PSWITCH) 
when considering value == (unsigned int)0 from alsaaudio.c:1302
taking False path
1303     {
1304         item = PyUnicode_FromString("Playback Mute");
1305         PyList_Append(result, item);
1306         Py_DECREF(item);
1307     }
1308     if (self->volume_cap&MIXER_CAP_PSWITCH_JOINED) 
when considering value == (unsigned int)0 from alsaaudio.c:1308
taking False path
1309     {
1310         item = PyUnicode_FromString("Joined Playback Mute");
1311         PyList_Append(result, item);
1312         Py_DECREF(item);
1313     }
1314     if (self->volume_cap&MIXER_CAP_CSWITCH) 
when considering range: 1 <= value <= 16
taking True path
1315     {
1316         item = PyUnicode_FromString("Capture Mute");
when PyUnicodeUCS4_FromString() succeeds
new ref from (unknown) PyUnicodeUCS4_FromString allocated at:         item = PyUnicode_FromString("Capture Mute");
ob_refcnt is now refs: 1 + N where N >= 0
1317         PyList_Append(result, item);
when PyList_Append() succeeds
ob_refcnt is now refs: 2 + N where N >= 0
new ref from (unknown) PyUnicodeUCS4_FromString is now referenced by 1 non-stack value(s): PyListObject.ob_item[0]
1318         Py_DECREF(item);
taking True path
ob_refcnt is now refs: 1 + N where N >= 0
1319     }
1320     if (self->volume_cap&MIXER_CAP_CSWITCH_JOINED) 
when considering value == (unsigned int)0 from alsaaudio.c:1320
taking False path
1321     {
1322         item = PyUnicode_FromString("Joined Capture Mute");
1323         PyList_Append(result, item);
1324         Py_DECREF(item);
1325     }
1326     if (self->volume_cap&MIXER_CAP_CSWITCH_EXCLUSIVE) 
when considering range: 1 <= value <= 64
taking True path
1327     {
1328         item = PyUnicode_FromString("Capture Exclusive");
when PyUnicodeUCS4_FromString() succeeds
1329         PyList_Append(result, item);
when PyList_Append() succeeds
new ref from (unknown) PyUnicodeUCS4_FromString is now referenced by 0 non-stack value(s): 
1330         Py_DECREF(item);
taking True path
1331     }
1332 
1333     return result;
1334 }
ob_refcnt of new ref from (unknown) PyUnicodeUCS4_FromString is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1
found 1 similar trace(s) to this

File: alsaaudio.c
Function: alsamixer_switchcap
Error: dereferencing NULL (item->ob_refcnt) at alsaaudio.c:1330
1274 static PyObject *
1275 alsamixer_switchcap(alsamixer_t *self, PyObject *args) 
1276 {
1277     PyObject *result;
1278     PyObject *item;
1279 
1280     if (!PyArg_ParseTuple(args,":switchcap")) 
when PyArg_ParseTuple() succeeds
taking False path
1281         return NULL;
1282 
1283     if (!self->handle) 
when treating unknown struct snd_mixer_t * from alsaaudio.c:1283 as non-NULL
taking False path
1284     {
1285         PyErr_SetString(ALSAAudioError, "Mixer is closed");
1286         return NULL;
1287     }
1288 
1289     result = PyList_New(0);
when PyList_New() succeeds
1290     if (self->volume_cap&MIXER_CAP_SWITCH) 
when considering value == (int)0 from alsaaudio.c:1290
taking False path
1291     {
1292         item = PyUnicode_FromString("Mute");
1293         PyList_Append(result, item);
1294         Py_DECREF(item);
1295     }
1296     if (self->volume_cap&MIXER_CAP_SWITCH_JOINED) 
when considering value == (unsigned int)0 from alsaaudio.c:1296
taking False path
1297     {
1298         item = PyUnicode_FromString("Joined Mute");
1299         PyList_Append(result, item);
1300         Py_DECREF(item);
1301     }
1302     if (self->volume_cap&MIXER_CAP_PSWITCH) 
when considering value == (unsigned int)0 from alsaaudio.c:1302
taking False path
1303     {
1304         item = PyUnicode_FromString("Playback Mute");
1305         PyList_Append(result, item);
1306         Py_DECREF(item);
1307     }
1308     if (self->volume_cap&MIXER_CAP_PSWITCH_JOINED) 
when considering value == (unsigned int)0 from alsaaudio.c:1308
taking False path
1309     {
1310         item = PyUnicode_FromString("Joined Playback Mute");
1311         PyList_Append(result, item);
1312         Py_DECREF(item);
1313     }
1314     if (self->volume_cap&MIXER_CAP_CSWITCH) 
when considering range: 1 <= value <= 16
taking True path
1315     {
1316         item = PyUnicode_FromString("Capture Mute");
when PyUnicodeUCS4_FromString() succeeds
1317         PyList_Append(result, item);
when PyList_Append() succeeds
1318         Py_DECREF(item);
taking True path
1319     }
1320     if (self->volume_cap&MIXER_CAP_CSWITCH_JOINED) 
when considering value == (unsigned int)0 from alsaaudio.c:1320
taking False path
1321     {
1322         item = PyUnicode_FromString("Joined Capture Mute");
1323         PyList_Append(result, item);
1324         Py_DECREF(item);
1325     }
1326     if (self->volume_cap&MIXER_CAP_CSWITCH_EXCLUSIVE) 
when considering range: 1 <= value <= 64
taking True path
1327     {
1328         item = PyUnicode_FromString("Capture Exclusive");
when PyUnicodeUCS4_FromString() fails
1329         PyList_Append(result, item);
returning -1 from PyList_Append() due to NULL item
1330         Py_DECREF(item);
dereferencing NULL (item->ob_refcnt) at alsaaudio.c:1330
found 4 similar trace(s) to this
1331     }
1332 
1333     return result;
1334 }

File: alsaaudio.c
Function: alsamixer_switchcap
Error: dereferencing NULL (item->ob_refcnt) at alsaaudio.c:1324
1274 static PyObject *
1275 alsamixer_switchcap(alsamixer_t *self, PyObject *args) 
1276 {
1277     PyObject *result;
1278     PyObject *item;
1279 
1280     if (!PyArg_ParseTuple(args,":switchcap")) 
when PyArg_ParseTuple() succeeds
taking False path
1281         return NULL;
1282 
1283     if (!self->handle) 
when treating unknown struct snd_mixer_t * from alsaaudio.c:1283 as non-NULL
taking False path
1284     {
1285         PyErr_SetString(ALSAAudioError, "Mixer is closed");
1286         return NULL;
1287     }
1288 
1289     result = PyList_New(0);
when PyList_New() succeeds
1290     if (self->volume_cap&MIXER_CAP_SWITCH) 
when considering value == (int)0 from alsaaudio.c:1290
taking False path
1291     {
1292         item = PyUnicode_FromString("Mute");
1293         PyList_Append(result, item);
1294         Py_DECREF(item);
1295     }
1296     if (self->volume_cap&MIXER_CAP_SWITCH_JOINED) 
when considering value == (unsigned int)0 from alsaaudio.c:1296
taking False path
1297     {
1298         item = PyUnicode_FromString("Joined Mute");
1299         PyList_Append(result, item);
1300         Py_DECREF(item);
1301     }
1302     if (self->volume_cap&MIXER_CAP_PSWITCH) 
when considering value == (unsigned int)0 from alsaaudio.c:1302
taking False path
1303     {
1304         item = PyUnicode_FromString("Playback Mute");
1305         PyList_Append(result, item);
1306         Py_DECREF(item);
1307     }
1308     if (self->volume_cap&MIXER_CAP_PSWITCH_JOINED) 
when considering value == (unsigned int)0 from alsaaudio.c:1308
taking False path
1309     {
1310         item = PyUnicode_FromString("Joined Playback Mute");
1311         PyList_Append(result, item);
1312         Py_DECREF(item);
1313     }
1314     if (self->volume_cap&MIXER_CAP_CSWITCH) 
when considering value == (unsigned int)0 from alsaaudio.c:1314
taking False path
1315     {
1316         item = PyUnicode_FromString("Capture Mute");
1317         PyList_Append(result, item);
1318         Py_DECREF(item);
1319     }
1320     if (self->volume_cap&MIXER_CAP_CSWITCH_JOINED) 
when considering range: 1 <= value <= 32
taking True path
1321     {
1322         item = PyUnicode_FromString("Joined Capture Mute");
when PyUnicodeUCS4_FromString() fails
1323         PyList_Append(result, item);
returning -1 from PyList_Append() due to NULL item
1324         Py_DECREF(item);
dereferencing NULL (item->ob_refcnt) at alsaaudio.c:1324
1325     }
1326     if (self->volume_cap&MIXER_CAP_CSWITCH_EXCLUSIVE) 
1327     {
1328         item = PyUnicode_FromString("Capture Exclusive");
1329         PyList_Append(result, item);
1330         Py_DECREF(item);
1331     }
1332 
1333     return result;
1334 }