File: krb5module.c
Function: RCache_setattr
Error: ob_refcnt of new ref from call to PyObject_GetAttrString is 1 too high
3346 static PyObject*
3347 RCache_setattr(PyObject *unself __UNUSED, PyObject *args)
3348 {
3349   char *name;
3350   PyObject *self, *value, *nameo, *tmp;
3351   PyInstanceObject *inst;
3352   krb5_context ctx = NULL;
3353   krb5_rcache rcache = NULL;
3354 
3355   if(!PyArg_ParseTuple(args, "OO!O:__setattr__", &self, &PyString_Type, &nameo, &value))
when PyArg_ParseTuple() succeeds
taking False path
3356     return NULL;
3357   inst = (PyInstanceObject *)self;
3358 
3359   name = PyString_AsString(nameo);
when PyString_AsString() succeeds
3360 
3361   if(strcmp(name, "context") && strcmp(name, "_rcache"))
taking False path
when considering range: -0x80000000 <= value <= -1
taking True path
taking False path
when considering range: -0x80000000 <= value <= -1
taking True path
3362     {
3363       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
3364       if(tmp)
taking True path
3365 	{
3366 	  tmp = PyObject_GetAttrString(tmp, "_ctx");
when PyObject_GetAttrString() succeeds
3367 	  if(tmp)
taking True path
3368 	    ctx = PyCObject_AsVoidPtr(tmp);
when PyCObject_AsVoidPtr() returns
3369 	}
3370       tmp = PyObject_GetAttrString(self, "_rcache");
when PyObject_GetAttrString() succeeds
3371       if(tmp)
taking True path
3372 	rcache = PyCObject_AsVoidPtr(tmp);
when PyCObject_AsVoidPtr() returns
3373     }
3374 
3375   if((!strcmp(name, "context") && ctx)
taking False path
when considering range: 1 <= value <= 0x7fffffff
taking False path
3376      || (!strcmp(name, "_rcache") && rcache))
taking False path
when considering range: 1 <= value <= 0x7fffffff
taking False path
3377     {
3378       PyErr_Format(PyExc_AttributeError, "You cannot set attribute '%.400s'", name);
3379       return NULL;
3380     }
3381   else
3382     PyDict_SetItem(inst->in_dict, nameo, value);
when treating unknown struct PyObject * from krb5module.c:3382 as non-NULL
when PyDict_SetItem() succeeds
3383 
3384   Py_INCREF(Py_None);
3385   return Py_None;
3386 }
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 62 similar trace(s) to this