File: isys.c
Function: doUMount
Error: ob_refcnt of '*tuple' is 1 too high
149 static PyObject * doUMount(PyObject * s, PyObject * args) {
150     char *err = NULL, *mntpoint = NULL;
151     int rc;
152 
153     if (!PyArg_ParseTuple(args, "s", &mntpoint)) {
154         return NULL;
when PyArg_ParseTuple() succeeds
taking False path
155     }
156 
157     rc = doPwUmount(mntpoint, &err);
158     if (rc == IMOUNT_ERR_ERRNO) {
159         PyErr_SetFromErrno(PyExc_SystemError);
when considering range: -0x80000000 <= value <= -2
taking False path
160     } else if (rc) {
161         PyObject *tuple = PyTuple_New(2);
taking True path
162 
when PyTuple_New() succeeds
PyTupleObject allocated at:         PyObject *tuple = PyTuple_New(2);
ob_refcnt is now refs: 1 + N where N >= 0
163         PyTuple_SetItem(tuple, 0, PyInt_FromLong(rc));
164 
when PyInt_FromLong() succeeds
when PyTuple_SetItem() succeeds
165         if (err == NULL) {
166             Py_INCREF(Py_None);
when treating unknown char * * from isys.c:158 as non-NULL
taking False path
167             PyTuple_SetItem(tuple, 1, Py_None);
168         } else {
169             PyTuple_SetItem(tuple, 1, PyString_FromString(err));
170         }
when PyString_FromString() succeeds
when PyTuple_SetItem() succeeds
171 
172         PyErr_SetObject(PyExc_SystemError, tuple);
173     }
calling PyErr_SetObject()
ob_refcnt is now refs: 1 + N where N >= 1
174 
175     if (rc) {
176         return NULL;
taking True path
177     }
178 
179     Py_INCREF(Py_None);
180     return Py_None;
181 }
182 
ob_refcnt of '*tuple' 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 11 similar trace(s) to this

File: isys.c
Function: doUMount
Error: calling PyTuple_SetItem with NULL as argument 1 (tuple) at isys.c:164
149 static PyObject * doUMount(PyObject * s, PyObject * args) {
150     char *err = NULL, *mntpoint = NULL;
151     int rc;
152 
153     if (!PyArg_ParseTuple(args, "s", &mntpoint)) {
154         return NULL;
when PyArg_ParseTuple() succeeds
taking False path
155     }
156 
157     rc = doPwUmount(mntpoint, &err);
158     if (rc == IMOUNT_ERR_ERRNO) {
159         PyErr_SetFromErrno(PyExc_SystemError);
when considering range: -0x80000000 <= value <= -2
taking False path
160     } else if (rc) {
161         PyObject *tuple = PyTuple_New(2);
taking True path
162 
when PyTuple_New() fails
163         PyTuple_SetItem(tuple, 0, PyInt_FromLong(rc));
164 
when PyInt_FromLong() succeeds
calling PyTuple_SetItem with NULL as argument 1 (tuple) at isys.c:164
PyTuple_SetItem() invokes Py_TYPE() on the pointer via the PyTuple_Check() macro, thus accessing (NULL)->ob_type
found 3 similar trace(s) to this
165         if (err == NULL) {
166             Py_INCREF(Py_None);
167             PyTuple_SetItem(tuple, 1, Py_None);
168         } else {
169             PyTuple_SetItem(tuple, 1, PyString_FromString(err));
170         }
171 
172         PyErr_SetObject(PyExc_SystemError, tuple);
173     }
174 
175     if (rc) {
176         return NULL;
177     }
178 
179     Py_INCREF(Py_None);
180     return Py_None;
181 }
182