2621 static PyObject*
2622 CCache_getattr(PyObject *unself __UNUSED, PyObject *args)
2623 {
2624 char *name;
2625 PyObject *retval = NULL, *self, *tmp;
2626 krb5_context ctx = NULL;
2627 krb5_ccache ccache = NULL;
2628
2629 if(!PyArg_ParseTuple(args, "Os:__getattr__", &self, &name))
when PyArg_ParseTuple() succeeds
taking False path
2630 return NULL;
2631
2632 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
2633 {
2634 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
2635 if(tmp)
taking True path
2636 {
2637 tmp = PyObject_GetAttrString(tmp, "_ctx");
when PyObject_GetAttrString() succeeds
2638 if(tmp)
taking True path
2639 ctx = PyCObject_AsVoidPtr(tmp);
when PyCObject_AsVoidPtr() returns
2640 }
2641 tmp = PyObject_GetAttrString(self, "_ccache");
when PyObject_GetAttrString() fails
2642 if(tmp)
taking False path
2643 ccache = PyCObject_AsVoidPtr(tmp);
2644 }
2645
2646 if(!strcmp(name, "name"))
taking False path
when considering value == (int)0 from krb5module.c:2646
taking True path
2647 {
2648 const char *nom;
2649
2650 nom = krb5_cc_get_name(ctx, ccache);
2651 retval = PyString_FromString(nom);
when treating unknown const char * from krb5module.c:2650 as non-NULL
when PyString_FromString() succeeds
2652 }
2653 else if(!strcmp(name, "type"))
2654 {
2655 const char *type;
2656
2657 type = krb5_cc_get_type(ctx, ccache);
2658 if(type)
2659 retval = PyString_FromString(type);
2660 else
2661 {
2662 retval = Py_None;
2663 Py_INCREF(Py_None);
2664 }
2665 }
2666 else
2667 {
2668 PyErr_Format(PyExc_AttributeError, "%.50s instance has no attribute '%.400s'",
2669 PyString_AS_STRING(((PyInstanceObject *)self)->in_class->cl_name), name);
2670 retval = NULL;
2671 }
2672
2673 return retval;
2674 } /* KrbV.CCache.__getattr__() */
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 47 similar trace(s) to this