File: krb5module.c
Function: Context_getattr
Error: ob_refcnt of '*ctx' is 1 too high
91 static PyObject*
92 Context_getattr(PyObject *unself __UNUSED, PyObject *args)
93 {
94   char *name;
95   PyObject *retval = NULL, *self;
96   krb5_context kctx = NULL;
97   krb5_error_code rc;
98 
99   if(!PyArg_ParseTuple(args, "Os:__getattr__", &self, &name))
when PyArg_ParseTuple() succeeds
taking False path
100     return NULL;
101 
102   if(strcmp(name, "_ctx"))
taking False path
when considering range: 1 <= value <= 0x7fffffff
taking True path
103     {
104       PyObject *ctx;
105       ctx = PyObject_GetAttrString(self, "_ctx");
when PyObject_GetAttrString() succeeds
new ref from call to PyObject_GetAttrString allocated at:       ctx = PyObject_GetAttrString(self, "_ctx");
ob_refcnt is now refs: 1 + N where N >= 0
106       if(!ctx)
taking False path
107 	return NULL;
108       kctx = PyCObject_AsVoidPtr(ctx);
when PyCObject_AsVoidPtr() returns
109       if(!kctx)
when treating unknown void * from krb5module.c:108 as non-NULL
taking False path
110 	return NULL;
111     }
112 
113   if(!strcmp(name, "default_realm"))
taking False path
when considering range: -0x80000000 <= value <= -1
taking False path
114     {
115       char *realm = NULL;
116 
117       rc = krb5_get_default_realm(kctx, &realm);
118       if(rc)
119 	return pk_error(rc);
120       retval = PyString_FromString(realm);
121       krb5_free_default_realm(kctx, realm);
122     }
123   else
124     {
125       PyErr_Format(PyExc_AttributeError, "%.50s instance has no attribute '%.400s'",
PyErr_Format()
126 		   PyString_AS_STRING(((PyInstanceObject *)self)->in_class->cl_name), name);
when treating unknown struct PyClassObject * from krb5module.c:126 as non-NULL
when treating unknown struct PyObject * from krb5module.c:126 as non-NULL
127       retval = NULL;
128     }
129 
130   return retval;
131 } /* KrbV.Context.__getattr__() */
ob_refcnt of '*ctx' 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 15 similar trace(s) to this

File: krb5module.c
Function: Context_getattr
Error: returning (PyObject*)NULL without setting an exception
91 static PyObject*
92 Context_getattr(PyObject *unself __UNUSED, PyObject *args)
93 {
94   char *name;
95   PyObject *retval = NULL, *self;
96   krb5_context kctx = NULL;
97   krb5_error_code rc;
98 
99   if(!PyArg_ParseTuple(args, "Os:__getattr__", &self, &name))
when PyArg_ParseTuple() succeeds
taking False path
100     return NULL;
101 
102   if(strcmp(name, "_ctx"))
taking False path
when considering range: -0x80000000 <= value <= -1
taking True path
103     {
104       PyObject *ctx;
105       ctx = PyObject_GetAttrString(self, "_ctx");
when PyObject_GetAttrString() succeeds
106       if(!ctx)
taking False path
107 	return NULL;
108       kctx = PyCObject_AsVoidPtr(ctx);
when PyCObject_AsVoidPtr() returns
109       if(!kctx)
when treating unknown void * from krb5module.c:108 as NULL
taking True path
110 	return NULL;
111     }
112 
113   if(!strcmp(name, "default_realm"))
114     {
115       char *realm = NULL;
116 
117       rc = krb5_get_default_realm(kctx, &realm);
118       if(rc)
119 	return pk_error(rc);
120       retval = PyString_FromString(realm);
121       krb5_free_default_realm(kctx, realm);
122     }
123   else
124     {
125       PyErr_Format(PyExc_AttributeError, "%.50s instance has no attribute '%.400s'",
126 		   PyString_AS_STRING(((PyInstanceObject *)self)->in_class->cl_name), name);
127       retval = NULL;
128     }
129 
130   return retval;
131 } /* KrbV.Context.__getattr__() */
returning (PyObject*)NULL without setting an exception