File: krb5module.c
Function: CCache_setattr
Error: ob_refcnt of new ref from call to PyObject_GetAttrString is 1 too high
2691 static PyObject*
2692 CCache_setattr(PyObject *unself __UNUSED, PyObject *args)
2693 {
2694   char *name;
2695   PyObject *self, *value, *nameo, *tmp;
2696   PyInstanceObject *inst;
2697   krb5_context ctx = NULL;
2698   krb5_ccache ccache = NULL;
2699 
2700   if(!PyArg_ParseTuple(args, "OO!O:__setattr__", &self, &PyString_Type, &nameo, &value))
when PyArg_ParseTuple() succeeds
taking False path
2701     return NULL;
2702   inst = (PyInstanceObject *)self;
2703 
2704   name = PyString_AsString(nameo);
when PyString_AsString() succeeds
2705 
2706   if(strcmp(name, "context") && strcmp(name, "_ccache"))
taking False path
when considering range: -0x80000000 <= value <= -1
taking True path
taking False path
when considering range: -0x80000000 <= value <= -1
taking True path
2707     {
2708       tmp = PyObject_GetAttrString(self, "context");
when PyObject_GetAttrString() succeeds
new ref from call to PyObject_GetAttrString allocated at:       tmp = PyObject_GetAttrString(self, "context");
ob_refcnt is now refs: 1 + N where N >= 0
2709       if(tmp)
taking True path
2710 	{
2711 	  tmp = PyObject_GetAttrString(tmp, "_ctx");
when PyObject_GetAttrString() succeeds
2712 	  if(tmp)
taking True path
2713 	    ctx = PyCObject_AsVoidPtr(tmp);
when PyCObject_AsVoidPtr() returns
2714 	}
2715       tmp = PyObject_GetAttrString(self, "_ccache");
when PyObject_GetAttrString() succeeds
2716       if(tmp)
taking True path
2717 	ccache = PyCObject_AsVoidPtr(tmp);
when PyCObject_AsVoidPtr() returns
2718     }
2719 
2720   if((!strcmp(name, "context") && ctx)
taking False path
when considering range: -0x80000000 <= value <= -1
taking False path
2721      || (!strcmp(name, "_ccache") && ccache)
taking False path
when considering value == (int)0 from krb5module.c:2721
taking True path
when treating unknown void * from krb5module.c:2717 as NULL
taking False path
2722      || !strcmp(name, "name")
taking False path
when considering range: 1 <= value <= 0x7fffffff
taking False path
2723      || !strcmp(name, "type")
taking False path
when considering range: -0x80000000 <= value <= -1
taking False path
2724      )
2725     {
2726       PyErr_Format(PyExc_AttributeError, "You cannot set attribute '%.400s'", name);
2727       return NULL;
2728     }
2729   else
2730     PyDict_SetItem(inst->in_dict, nameo, value);
when treating unknown struct PyObject * from krb5module.c:2730 as non-NULL
when PyDict_SetItem() succeeds
2731 
2732   Py_INCREF(Py_None);
2733   return Py_None;
2734 } /* KrbV.CCache.__setattr__() */
ob_refcnt of new ref from call to PyObject_GetAttrString 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 59 similar trace(s) to this