File: | ./libxml.c |
Function: | pythonAttributeDecl |
Error: | ob_refcnt of '*newName' is 1 too low |
1151 static void
1152 pythonAttributeDecl(void *user_data,
1153 const xmlChar * elem,
1154 const xmlChar * name,
1155 int type,
1156 int def,
1157 const xmlChar * defaultValue, xmlEnumerationPtr tree)
1158 {
1159 PyObject *handler;
1160 PyObject *nameList;
1161 PyObject *newName;
1162 xmlEnumerationPtr node;
1163 PyObject *result;
1164 int count;
1165
1166 handler = (PyObject *) user_data;
1167 if (PyObject_HasAttrString(handler, (char *) "attributeDecl")) {
when treating unknown void * from ./libxml.c:1152 as non-NULL
when PyObject_HasAttrString() returns 1 (true)
taking True path
1168 count = 0;
1169 for (node = tree; node != NULL; node = node->next) {
when treating unknown struct xmlEnumeration * from ./libxml.c:1157 as non-NULL
taking True path
when treating unknown struct _xmlEnumeration * from ./libxml.c:1169 as NULL
taking False path
1170 count++;
1171 }
1172 nameList = PyList_New(count);
when PyList_New() succeeds
1173 count = 0;
1174 for (node = tree; node != NULL; node = node->next) {
taking True path
when treating unknown struct _xmlEnumeration * from ./libxml.c:1174 as NULL
taking False path
1175 newName = PyString_FromString((char *) node->name);
when treating unknown const xmlChar * from ./libxml.c:1175 as non-NULL
when PyString_FromString() succeeds
PyStringObject allocated at: newName = PyString_FromString((char *) node->name);
ob_refcnt is now refs: 1 + N where N >= 0
1176 PyList_SetItem(nameList, count, newName);
PyList_SetItem() succeeds
ob_refcnt is now refs: 0 + N where N >= 1
1177 Py_DECREF(newName);
when taking True path
ob_refcnt is now refs: -1 + N where N >= 1
1178 count++;
1179 }
1180 result = PyObject_CallMethod(handler, (char *) "attributeDecl",
when PyObject_CallMethod() succeeds
1181 (char *) "ssiisO", elem, name, type,
1182 def, defaultValue, nameList);
1183 if (PyErr_Occurred())
PyErr_Occurred()
taking False path
1184 PyErr_Print();
1185 Py_XDECREF(nameList);
taking False path
when taking True path
1186 Py_XDECREF(result);
taking False path
when taking True path
1187 }
1188 }
returning
ob_refcnt of '*newName' is 1 too low
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + -1
found 5 similar trace(s) to this
File: | ./libxml.c |
Function: | pythonAttributeDecl |
Error: | dereferencing NULL (newName->ob_refcnt) at ./libxml.c:1177 |
1151 static void
1152 pythonAttributeDecl(void *user_data,
1153 const xmlChar * elem,
1154 const xmlChar * name,
1155 int type,
1156 int def,
1157 const xmlChar * defaultValue, xmlEnumerationPtr tree)
1158 {
1159 PyObject *handler;
1160 PyObject *nameList;
1161 PyObject *newName;
1162 xmlEnumerationPtr node;
1163 PyObject *result;
1164 int count;
1165
1166 handler = (PyObject *) user_data;
1167 if (PyObject_HasAttrString(handler, (char *) "attributeDecl")) {
when treating unknown void * from ./libxml.c:1152 as non-NULL
when PyObject_HasAttrString() returns 1 (true)
taking True path
1168 count = 0;
1169 for (node = tree; node != NULL; node = node->next) {
when treating unknown struct xmlEnumeration * from ./libxml.c:1157 as non-NULL
taking True path
when treating unknown struct _xmlEnumeration * from ./libxml.c:1169 as NULL
taking False path
1170 count++;
1171 }
1172 nameList = PyList_New(count);
when PyList_New() succeeds
1173 count = 0;
1174 for (node = tree; node != NULL; node = node->next) {
taking True path
1175 newName = PyString_FromString((char *) node->name);
when treating unknown const xmlChar * from ./libxml.c:1175 as non-NULL
when PyString_FromString() fails
1176 PyList_SetItem(nameList, count, newName);
PyList_SetItem() succeeds
1177 Py_DECREF(newName);
dereferencing NULL (newName->ob_refcnt) at ./libxml.c:1177
1178 count++;
1179 }
1180 result = PyObject_CallMethod(handler, (char *) "attributeDecl",
1181 (char *) "ssiisO", elem, name, type,
1182 def, defaultValue, nameList);
1183 if (PyErr_Occurred())
1184 PyErr_Print();
1185 Py_XDECREF(nameList);
1186 Py_XDECREF(result);
1187 }
1188 }
File: | ./libxml.c |
Function: | pythonAttributeDecl |
Error: | calling PyList_SetItem with NULL as argument 1 (nameList) at ./libxml.c:1176 |
1151 static void
1152 pythonAttributeDecl(void *user_data,
1153 const xmlChar * elem,
1154 const xmlChar * name,
1155 int type,
1156 int def,
1157 const xmlChar * defaultValue, xmlEnumerationPtr tree)
1158 {
1159 PyObject *handler;
1160 PyObject *nameList;
1161 PyObject *newName;
1162 xmlEnumerationPtr node;
1163 PyObject *result;
1164 int count;
1165
1166 handler = (PyObject *) user_data;
1167 if (PyObject_HasAttrString(handler, (char *) "attributeDecl")) {
when treating unknown void * from ./libxml.c:1152 as non-NULL
when PyObject_HasAttrString() returns 1 (true)
taking True path
1168 count = 0;
1169 for (node = tree; node != NULL; node = node->next) {
when treating unknown struct xmlEnumeration * from ./libxml.c:1157 as non-NULL
taking True path
when treating unknown struct _xmlEnumeration * from ./libxml.c:1169 as NULL
taking False path
1170 count++;
1171 }
1172 nameList = PyList_New(count);
when PyList_New() fails
1173 count = 0;
1174 for (node = tree; node != NULL; node = node->next) {
taking True path
1175 newName = PyString_FromString((char *) node->name);
when treating unknown const xmlChar * from ./libxml.c:1175 as non-NULL
when PyString_FromString() succeeds
1176 PyList_SetItem(nameList, count, newName);
calling PyList_SetItem with NULL as argument 1 (nameList) at ./libxml.c:1176
PyList_SetItem() invokes Py_TYPE() on the pointer via the PyList_Check() macro, thus accessing (NULL)->ob_type
found 1 similar trace(s) to this
1177 Py_DECREF(newName);
1178 count++;
1179 }
1180 result = PyObject_CallMethod(handler, (char *) "attributeDecl",
1181 (char *) "ssiisO", elem, name, type,
1182 def, defaultValue, nameList);
1183 if (PyErr_Occurred())
1184 PyErr_Print();
1185 Py_XDECREF(nameList);
1186 Py_XDECREF(result);
1187 }
1188 }