File: meld3/cmeld3.c
Function: bfclonehandler
Error: ob_refcnt of new ref from (unknown) bfclone is 1 too high
116 static PyObject*
117 bfclonehandler(PyObject *self, PyObject *args)
118 {
119     PyObject *node, *parent;
120 	
121     if (!PyArg_ParseTuple(args, "OO:clone", &node, &parent)) {
when PyArg_ParseTuple() succeeds
taking False path
122 	return NULL;
123     }
124     
125     PyObject *klass;
126     PyObject *children;
127     PyObject *text;
128     PyObject *tail;
129     PyObject *tag;
130     PyObject *attrib;
131     PyObject *structure;
132     PyObject *dict;
133     PyObject *newdict;
134     PyObject *newchildren;
135     PyObject *attrib_copy;
136     PyObject *element;
137 
138     if (!(klass = PyObject_GetAttr(node, PySTR__class__))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:6 as non-NULL
when PyObject_GetAttr() succeeds
taking False path
139     if (!(dict = PyObject_GetAttr(node, PySTR__dict__))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:6 as non-NULL
when PyObject_GetAttr() succeeds
taking False path
140     
141     if (!(children = PyDict_GetItem(dict, PySTR_children))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:6 as non-NULL
when PyDict_GetItem() succeeds
taking False path
142     if (!(tag = PyDict_GetItem(dict, PySTRtag))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:8 as non-NULL
when PyDict_GetItem() succeeds
taking False path
143     if (!(attrib = PyDict_GetItem(dict, PySTRattrib))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:7 as non-NULL
when PyDict_GetItem() succeeds
taking False path
144     
145     if (!(text = PyDict_GetItem(dict, PySTRtext))) {
when treating unknown struct PyObject * from meld3/cmeld3.c:8 as non-NULL
when PyDict_GetItem() succeeds
taking False path
146 	text = Py_None;
147     }
148     if (!(tail = PyDict_GetItem(dict, PySTRtail))) {
when treating unknown struct PyObject * from meld3/cmeld3.c:8 as non-NULL
when PyDict_GetItem() succeeds
taking False path
149 	tail = Py_None;
150     }
151     if (!(structure = PyDict_GetItem(dict, PySTRstructure))) {
when treating unknown struct PyObject * from meld3/cmeld3.c:8 as non-NULL
when PyDict_GetItem() succeeds
taking False path
152 	structure = Py_None;
153     }
154 
155     Py_DECREF(dict);
when taking True path
156 
157     if (!(newdict = PyDict_New())) return NULL;
when PyDict_New() succeeds
taking False path
158     if (!(newchildren = PyList_New(0))) return NULL;
when PyList_New() succeeds
taking False path
159 
160     attrib_copy = PyDict_Copy(attrib);
when PyDict_Copy() succeeds
161 
162     PyDict_SetItem(newdict, PySTR_children, newchildren);
when PyDict_SetItem() succeeds
163     Py_DECREF(newchildren);
taking True path
164     PyDict_SetItem(newdict, PySTRattrib, attrib_copy);
when PyDict_SetItem() succeeds
165     Py_DECREF(attrib_copy);
taking True path
166     PyDict_SetItem(newdict, PySTRtext, text);
when PyDict_SetItem() succeeds
167     PyDict_SetItem(newdict, PySTRtail, tail);
when PyDict_SetItem() succeeds
168     PyDict_SetItem(newdict, PySTRtag, tag);
when PyDict_SetItem() succeeds
169     PyDict_SetItem(newdict, PySTRstructure, structure);
when PyDict_SetItem() succeeds
170     PyDict_SetItem(newdict, PySTRparent, parent);
when treating unknown struct PyObject * from meld3/cmeld3.c:7 as non-NULL
when PyDict_SetItem() succeeds
171 
172     if (!(element = PyInstance_NewRaw(klass, newdict))) return NULL;
when PyInstance_NewRaw() succeeds
taking False path
173     Py_DECREF(newdict);
when taking True path
174     Py_DECREF(klass);
when taking False path
calling tp_dealloc on new ref from call to PyObject_GetAttr allocated at meld3/cmeld3.c:138
175 
176     PyObject *pchildren;
177     
178     if (parent != Py_None) {
taking True path
179         if (!(pchildren=PyObject_GetAttr(parent, PySTR_children))) return NULL;
when PyObject_GetAttr() succeeds
taking False path
180 	if (PyList_Append(pchildren, element)) return NULL;
when treating ob_size as 0
when PyList_Append() succeeds
taking False path
181         Py_DECREF(pchildren);
when taking False path
calling tp_dealloc on new ref from call to PyObject_GetAttr allocated at meld3/cmeld3.c:179
182     }
183 
184     if (!(PyList_Check(children))) return NULL;
when considering range: 1 <= value <= 0x2000000
taking False path
185 
186     if (PyList_Size(children) > 0) {
when PyList_Size() returns ob_size
when considering range: 1 <= value <= 0x7fffffffffffffff
taking True path
187 	if (bfclone(children, element) == NULL) {
when bfclone() succeeds
taking False path
new ref from (unknown) bfclone allocated at: 	if (bfclone(children, element) == NULL) {
ob_refcnt is now refs: 1 + N where N >= 0
188 	    return NULL;
189 	}
190     }
191     return element;
192     
193 }
ob_refcnt of new ref from (unknown) bfclone 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 3 similar trace(s) to this

File: meld3/cmeld3.c
Function: bfclonehandler
Error: ob_refcnt of '*element' is 1 too high
116 static PyObject*
117 bfclonehandler(PyObject *self, PyObject *args)
118 {
119     PyObject *node, *parent;
120 	
121     if (!PyArg_ParseTuple(args, "OO:clone", &node, &parent)) {
when PyArg_ParseTuple() succeeds
taking False path
122 	return NULL;
123     }
124     
125     PyObject *klass;
126     PyObject *children;
127     PyObject *text;
128     PyObject *tail;
129     PyObject *tag;
130     PyObject *attrib;
131     PyObject *structure;
132     PyObject *dict;
133     PyObject *newdict;
134     PyObject *newchildren;
135     PyObject *attrib_copy;
136     PyObject *element;
137 
138     if (!(klass = PyObject_GetAttr(node, PySTR__class__))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:6 as non-NULL
when PyObject_GetAttr() succeeds
taking False path
139     if (!(dict = PyObject_GetAttr(node, PySTR__dict__))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:6 as non-NULL
when PyObject_GetAttr() succeeds
taking False path
140     
141     if (!(children = PyDict_GetItem(dict, PySTR_children))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:6 as non-NULL
when PyDict_GetItem() succeeds
taking False path
142     if (!(tag = PyDict_GetItem(dict, PySTRtag))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:8 as non-NULL
when PyDict_GetItem() succeeds
taking False path
143     if (!(attrib = PyDict_GetItem(dict, PySTRattrib))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:7 as non-NULL
when PyDict_GetItem() succeeds
taking False path
144     
145     if (!(text = PyDict_GetItem(dict, PySTRtext))) {
when treating unknown struct PyObject * from meld3/cmeld3.c:8 as non-NULL
when PyDict_GetItem() succeeds
taking False path
146 	text = Py_None;
147     }
148     if (!(tail = PyDict_GetItem(dict, PySTRtail))) {
when treating unknown struct PyObject * from meld3/cmeld3.c:8 as non-NULL
when PyDict_GetItem() succeeds
taking False path
149 	tail = Py_None;
150     }
151     if (!(structure = PyDict_GetItem(dict, PySTRstructure))) {
when treating unknown struct PyObject * from meld3/cmeld3.c:8 as non-NULL
when PyDict_GetItem() succeeds
taking False path
152 	structure = Py_None;
153     }
154 
155     Py_DECREF(dict);
when taking True path
156 
157     if (!(newdict = PyDict_New())) return NULL;
when PyDict_New() succeeds
taking False path
158     if (!(newchildren = PyList_New(0))) return NULL;
when PyList_New() succeeds
taking False path
159 
160     attrib_copy = PyDict_Copy(attrib);
when PyDict_Copy() succeeds
161 
162     PyDict_SetItem(newdict, PySTR_children, newchildren);
when PyDict_SetItem() succeeds
163     Py_DECREF(newchildren);
taking True path
164     PyDict_SetItem(newdict, PySTRattrib, attrib_copy);
when PyDict_SetItem() succeeds
165     Py_DECREF(attrib_copy);
taking True path
166     PyDict_SetItem(newdict, PySTRtext, text);
when PyDict_SetItem() succeeds
167     PyDict_SetItem(newdict, PySTRtail, tail);
when PyDict_SetItem() succeeds
168     PyDict_SetItem(newdict, PySTRtag, tag);
when PyDict_SetItem() succeeds
169     PyDict_SetItem(newdict, PySTRstructure, structure);
when PyDict_SetItem() succeeds
170     PyDict_SetItem(newdict, PySTRparent, parent);
when treating unknown struct PyObject * from meld3/cmeld3.c:7 as non-NULL
when PyDict_SetItem() succeeds
171 
172     if (!(element = PyInstance_NewRaw(klass, newdict))) return NULL;
when PyInstance_NewRaw() succeeds
taking False path
new ref from (unknown) PyInstance_NewRaw allocated at:     if (!(element = PyInstance_NewRaw(klass, newdict))) return NULL;
ob_refcnt is now refs: 1 + N where N >= 0
173     Py_DECREF(newdict);
when taking True path
174     Py_DECREF(klass);
when taking False path
calling tp_dealloc on new ref from call to PyObject_GetAttr allocated at meld3/cmeld3.c:138
175 
176     PyObject *pchildren;
177     
178     if (parent != Py_None) {
taking True path
179         if (!(pchildren=PyObject_GetAttr(parent, PySTR_children))) return NULL;
when PyObject_GetAttr() succeeds
taking False path
180 	if (PyList_Append(pchildren, element)) return NULL;
when treating ob_size as 0
when PyList_Append() succeeds
taking False path
ob_refcnt is now refs: 2 + N where N >= 0
'*element' is now referenced by 1 non-stack value(s): new ref from call to PyObject_GetAttr.ob_item[0]
181         Py_DECREF(pchildren);
when taking False path
calling tp_dealloc on new ref from call to PyObject_GetAttr allocated at meld3/cmeld3.c:179
182     }
183 
184     if (!(PyList_Check(children))) return NULL;
when considering value == (long int)0 from meld3/cmeld3.c:184
taking True path
185 
186     if (PyList_Size(children) > 0) {
187 	if (bfclone(children, element) == NULL) {
188 	    return NULL;
189 	}
190     }
191     return element;
192     
193 }
ob_refcnt of '*element' is 1 too high
was expecting final ob_refcnt to be N + 1 (for some unknown N)
due to object being referenced by: new ref from call to PyObject_GetAttr.ob_item[0]
but final ob_refcnt is N + 2
found 8 similar trace(s) to this

File: meld3/cmeld3.c
Function: bfclonehandler
Error: returning (PyObject*)NULL without setting an exception
116 static PyObject*
117 bfclonehandler(PyObject *self, PyObject *args)
118 {
119     PyObject *node, *parent;
120 	
121     if (!PyArg_ParseTuple(args, "OO:clone", &node, &parent)) {
when PyArg_ParseTuple() succeeds
taking False path
122 	return NULL;
123     }
124     
125     PyObject *klass;
126     PyObject *children;
127     PyObject *text;
128     PyObject *tail;
129     PyObject *tag;
130     PyObject *attrib;
131     PyObject *structure;
132     PyObject *dict;
133     PyObject *newdict;
134     PyObject *newchildren;
135     PyObject *attrib_copy;
136     PyObject *element;
137 
138     if (!(klass = PyObject_GetAttr(node, PySTR__class__))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:6 as non-NULL
when PyObject_GetAttr() succeeds
taking False path
139     if (!(dict = PyObject_GetAttr(node, PySTR__dict__))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:6 as non-NULL
when PyObject_GetAttr() succeeds
taking False path
140     
141     if (!(children = PyDict_GetItem(dict, PySTR_children))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:6 as non-NULL
when PyDict_GetItem() succeeds
taking False path
142     if (!(tag = PyDict_GetItem(dict, PySTRtag))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:8 as non-NULL
when PyDict_GetItem() succeeds
taking False path
143     if (!(attrib = PyDict_GetItem(dict, PySTRattrib))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:7 as non-NULL
when PyDict_GetItem() succeeds
taking False path
144     
145     if (!(text = PyDict_GetItem(dict, PySTRtext))) {
when treating unknown struct PyObject * from meld3/cmeld3.c:8 as non-NULL
when PyDict_GetItem() succeeds
taking False path
146 	text = Py_None;
147     }
148     if (!(tail = PyDict_GetItem(dict, PySTRtail))) {
when treating unknown struct PyObject * from meld3/cmeld3.c:8 as non-NULL
when PyDict_GetItem() succeeds
taking False path
149 	tail = Py_None;
150     }
151     if (!(structure = PyDict_GetItem(dict, PySTRstructure))) {
when treating unknown struct PyObject * from meld3/cmeld3.c:8 as non-NULL
when PyDict_GetItem() succeeds
taking False path
152 	structure = Py_None;
153     }
154 
155     Py_DECREF(dict);
when taking True path
156 
157     if (!(newdict = PyDict_New())) return NULL;
when PyDict_New() succeeds
taking False path
158     if (!(newchildren = PyList_New(0))) return NULL;
when PyList_New() succeeds
taking False path
159 
160     attrib_copy = PyDict_Copy(attrib);
when PyDict_Copy() succeeds
161 
162     PyDict_SetItem(newdict, PySTR_children, newchildren);
when PyDict_SetItem() succeeds
163     Py_DECREF(newchildren);
taking True path
164     PyDict_SetItem(newdict, PySTRattrib, attrib_copy);
when PyDict_SetItem() succeeds
165     Py_DECREF(attrib_copy);
taking True path
166     PyDict_SetItem(newdict, PySTRtext, text);
when PyDict_SetItem() succeeds
167     PyDict_SetItem(newdict, PySTRtail, tail);
when PyDict_SetItem() succeeds
168     PyDict_SetItem(newdict, PySTRtag, tag);
when PyDict_SetItem() succeeds
169     PyDict_SetItem(newdict, PySTRstructure, structure);
when PyDict_SetItem() succeeds
170     PyDict_SetItem(newdict, PySTRparent, parent);
when treating unknown struct PyObject * from meld3/cmeld3.c:7 as non-NULL
when PyDict_SetItem() succeeds
171 
172     if (!(element = PyInstance_NewRaw(klass, newdict))) return NULL;
when PyInstance_NewRaw() succeeds
taking False path
173     Py_DECREF(newdict);
when taking True path
174     Py_DECREF(klass);
when taking False path
calling tp_dealloc on new ref from call to PyObject_GetAttr allocated at meld3/cmeld3.c:138
175 
176     PyObject *pchildren;
177     
178     if (parent != Py_None) {
taking True path
179         if (!(pchildren=PyObject_GetAttr(parent, PySTR_children))) return NULL;
when PyObject_GetAttr() succeeds
taking False path
180 	if (PyList_Append(pchildren, element)) return NULL;
when treating ob_size as 0
when PyList_Append() succeeds
taking False path
181         Py_DECREF(pchildren);
when taking False path
calling tp_dealloc on new ref from call to PyObject_GetAttr allocated at meld3/cmeld3.c:179
182     }
183 
184     if (!(PyList_Check(children))) return NULL;
when considering value == (long int)0 from meld3/cmeld3.c:184
taking True path
185 
186     if (PyList_Size(children) > 0) {
187 	if (bfclone(children, element) == NULL) {
188 	    return NULL;
189 	}
190     }
191     return element;
192     
193 }
returning (PyObject*)NULL without setting an exception
found 3 similar trace(s) to this

File: meld3/cmeld3.c
Function: bfclonehandler
Error: ob_refcnt of '*pchildren' is 1 too high
116 static PyObject*
117 bfclonehandler(PyObject *self, PyObject *args)
118 {
119     PyObject *node, *parent;
120 	
121     if (!PyArg_ParseTuple(args, "OO:clone", &node, &parent)) {
when PyArg_ParseTuple() succeeds
taking False path
122 	return NULL;
123     }
124     
125     PyObject *klass;
126     PyObject *children;
127     PyObject *text;
128     PyObject *tail;
129     PyObject *tag;
130     PyObject *attrib;
131     PyObject *structure;
132     PyObject *dict;
133     PyObject *newdict;
134     PyObject *newchildren;
135     PyObject *attrib_copy;
136     PyObject *element;
137 
138     if (!(klass = PyObject_GetAttr(node, PySTR__class__))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:6 as non-NULL
when PyObject_GetAttr() succeeds
taking False path
139     if (!(dict = PyObject_GetAttr(node, PySTR__dict__))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:6 as non-NULL
when PyObject_GetAttr() succeeds
taking False path
140     
141     if (!(children = PyDict_GetItem(dict, PySTR_children))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:6 as non-NULL
when PyDict_GetItem() succeeds
taking False path
142     if (!(tag = PyDict_GetItem(dict, PySTRtag))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:8 as non-NULL
when PyDict_GetItem() succeeds
taking False path
143     if (!(attrib = PyDict_GetItem(dict, PySTRattrib))) return NULL;
when treating unknown struct PyObject * from meld3/cmeld3.c:7 as non-NULL
when PyDict_GetItem() succeeds
taking False path
144     
145     if (!(text = PyDict_GetItem(dict, PySTRtext))) {
when treating unknown struct PyObject * from meld3/cmeld3.c:8 as non-NULL
when PyDict_GetItem() succeeds
taking False path
146 	text = Py_None;
147     }
148     if (!(tail = PyDict_GetItem(dict, PySTRtail))) {
when treating unknown struct PyObject * from meld3/cmeld3.c:8 as non-NULL
when PyDict_GetItem() succeeds
taking False path
149 	tail = Py_None;
150     }
151     if (!(structure = PyDict_GetItem(dict, PySTRstructure))) {
when treating unknown struct PyObject * from meld3/cmeld3.c:8 as non-NULL
when PyDict_GetItem() succeeds
taking False path
152 	structure = Py_None;
153     }
154 
155     Py_DECREF(dict);
when taking True path
156 
157     if (!(newdict = PyDict_New())) return NULL;
when PyDict_New() succeeds
taking False path
158     if (!(newchildren = PyList_New(0))) return NULL;
when PyList_New() succeeds
taking False path
159 
160     attrib_copy = PyDict_Copy(attrib);
when PyDict_Copy() succeeds
161 
162     PyDict_SetItem(newdict, PySTR_children, newchildren);
when PyDict_SetItem() succeeds
163     Py_DECREF(newchildren);
taking True path
164     PyDict_SetItem(newdict, PySTRattrib, attrib_copy);
when PyDict_SetItem() succeeds
165     Py_DECREF(attrib_copy);
taking True path
166     PyDict_SetItem(newdict, PySTRtext, text);
when PyDict_SetItem() succeeds
167     PyDict_SetItem(newdict, PySTRtail, tail);
when PyDict_SetItem() succeeds
168     PyDict_SetItem(newdict, PySTRtag, tag);
when PyDict_SetItem() succeeds
169     PyDict_SetItem(newdict, PySTRstructure, structure);
when PyDict_SetItem() succeeds
170     PyDict_SetItem(newdict, PySTRparent, parent);
when treating unknown struct PyObject * from meld3/cmeld3.c:7 as non-NULL
when PyDict_SetItem() succeeds
171 
172     if (!(element = PyInstance_NewRaw(klass, newdict))) return NULL;
when PyInstance_NewRaw() succeeds
taking False path
173     Py_DECREF(newdict);
when taking True path
174     Py_DECREF(klass);
when taking True path
175 
176     PyObject *pchildren;
177     
178     if (parent != Py_None) {
taking True path
179         if (!(pchildren=PyObject_GetAttr(parent, PySTR_children))) return NULL;
when PyObject_GetAttr() succeeds
taking False path
new ref from call to PyObject_GetAttr allocated at:         if (!(pchildren=PyObject_GetAttr(parent, PySTR_children))) return NULL;
ob_refcnt is now refs: 1 + N where N >= 0
180 	if (PyList_Append(pchildren, element)) return NULL;
when treating ob_size as 0
when PyList_Append() fails
taking True path
181         Py_DECREF(pchildren);
182     }
183 
184     if (!(PyList_Check(children))) return NULL;
185 
186     if (PyList_Size(children) > 0) {
187 	if (bfclone(children, element) == NULL) {
188 	    return NULL;
189 	}
190     }
191     return element;
192     
193 }
ob_refcnt of '*pchildren' is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1