146 static PyObject*
147 Context_setattr(PyObject *unself __UNUSED, PyObject *args)
148 {
149 char *name;
150 PyObject *self, *value, *nameo;
151 PyInstanceObject *inst;
152 krb5_context kctx = NULL;
153
154 if(!PyArg_ParseTuple(args, "OO!O:__setattr__", &self, &PyString_Type, &nameo, &value))
when PyArg_ParseTuple() succeeds
taking False path
155 return NULL;
156 inst = (PyInstanceObject *)self;
157
158 name = PyString_AsString(nameo);
when PyString_AsString() succeeds
159
160 if(strcmp(name, "_ctx"))
taking False path
when considering range: -0x80000000 <= value <= -1
taking True path
161 {
162 PyObject *ctx;
163 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
164 if(!ctx)
taking False path
165 return NULL;
166 kctx = PyCObject_AsVoidPtr(ctx);
when PyCObject_AsVoidPtr() returns
167 if(!kctx)
when treating unknown void * from krb5module.c:166 as non-NULL
taking False path
168 return NULL;
169 }
170 if(!strcmp(name, "default_realm"))
taking False path
when considering range: -0x80000000 <= value <= -1
taking False path
171 {
172 if(!PyString_Check(value))
173 {
174 PyErr_Format(PyExc_TypeError, "argument 2 must be a string");
175 return NULL;
176 }
177 krb5_set_default_realm(kctx, PyString_AsString(value));
178 }
179 else if((!strcmp(name, "_ctx") && kctx))
taking False path
when considering range: -0x80000000 <= value <= -1
taking False path
180 {
181 PyErr_Format(PyExc_AttributeError, "You cannot set attribute '%.400s'", name);
182 return NULL;
183 }
184 else
185 PyDict_SetItem(inst->in_dict, nameo, value);
when treating unknown struct PyObject * from krb5module.c:185 as non-NULL
when PyDict_SetItem() succeeds
186
187 Py_INCREF(Py_None);
188 return Py_None;
189 } /* KrbV.Context.__setattr__() */
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 13 similar trace(s) to this