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}
fixed in 7abe51f8404f1788d4ed497d26b83b3097073229