Bug 8588 - Unused assignments in pytalloc
Unused assignments in pytalloc
Status: NEW
Product: TALLOC
Classification: Unclassified
Component: libtalloc
unspecified
All All
: P5 normal
: ---
Assigned To: Simo Sorce
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-08 18:47 UTC by Stephen Gallagher
Modified: 2011-11-08 18:47 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Gallagher 2011-11-08 18:47:22 UTC
Detected by Coverity 5.5.1 running against current (2011-11-08) samba master branch:


 51/* return the number of talloc blocks */
 52static PyObject *pytalloc_total_blocks(PyObject *self, PyObject *args)
 53{
 54        PyObject *py_obj = Py_None;
 55        PyTypeObject *type;
 56
 57        if (!PyArg_ParseTuple(args, "|O", &py_obj))
 58                return NULL;
 59
 60        if (py_obj == Py_None) {
 61                return PyLong_FromLong(talloc_total_blocks(NULL));
 62        }
 63
CID 10939: Unused pointer value (UNUSED_VALUE)Pointer "type" returned by "PyObject_Type(py_obj)" is never used.
 64        type = (PyTypeObject*)PyObject_Type(py_obj);
 65
 66        return PyLong_FromLong(talloc_total_blocks(pytalloc_get_mem_ctx(py_obj)));
 67}




And




 26/* print a talloc tree report for a talloc python object */
 27static PyObject *pytalloc_report_full(PyObject *self, PyObject *args)
 28{
 29        PyObject *py_obj = Py_None;
 30        PyTypeObject *type;
 31
 32        if (!PyArg_ParseTuple(args, "|O", &py_obj))
 33                return NULL;
 34
 35        if (py_obj == Py_None) {
 36                talloc_report_full(NULL, stdout);
 37        } else {
CID 10938: Unused pointer value (UNUSED_VALUE)Pointer "type" returned by "PyObject_Type(py_obj)" is never used.
 38                type = (PyTypeObject*)PyObject_Type(py_obj);
 39                talloc_report_full(pytalloc_get_mem_ctx(py_obj), stdout);
 40        }
 41        return Py_None;
 42}