File: | rpmmodule.c |
Function: | addRpmTags |
Error: | ob_refcnt of '*dict' is 1 too high |
170 */
171 static void addRpmTags(PyObject *module)
172 {
173 PyObject *pyval, *pyname, *dict = PyDict_New();
when PyDict_New() succeeds
PyDictObject allocated at: PyObject *pyval, *pyname, *dict = PyDict_New();
ob_refcnt is now refs: 1 + N where N >= 0
174 rpmtd names = rpmtdNew();
175 rpmTagGetNames(names, 1);
176 const char *tagname, *shortname;
177 rpmTagVal tagval;
178
179 while ((tagname = rpmtdNextString(names))) {
when treating unknown const char * from rpmmodule.c:179 as non-NULL
taking True path
when treating unknown const char * from rpmmodule.c:179 as NULL
taking False path
180 shortname = tagname + strlen("RPMTAG_");
181 tagval = rpmTagGetValue(shortname);
182
183 PyModule_AddIntConstant(module, tagname, tagval);
when PyModule_AddIntConstant() fails
184 pyval = PyInt_FromLong(tagval);
when PyInt_FromLong() succeeds
185 pyname = Py_BuildValue("s", shortname);
when Py_BuildValue() succeeds
186 PyDict_SetItem(dict, pyval, pyname);
when PyDict_SetItem() succeeds
187 Py_DECREF(pyval);
when taking True path
188 Py_DECREF(pyname);
when taking True path
189 }
190 PyModule_AddObject(module, "tagnames", dict);
when PyModule_AddObject() fails
191 rpmtdFreeData(names);
192 rpmtdFree(names);
193 }
returning
ob_refcnt of '*dict' 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 9 similar trace(s) to this
File: | rpmmodule.c |
Function: | addRpmTags |
Error: | calling PyDict_SetItem with NULL as argument 3 (pyname) at rpmmodule.c:186 |
170 */
171 static void addRpmTags(PyObject *module)
172 {
173 PyObject *pyval, *pyname, *dict = PyDict_New();
when PyDict_New() succeeds
174 rpmtd names = rpmtdNew();
175 rpmTagGetNames(names, 1);
176 const char *tagname, *shortname;
177 rpmTagVal tagval;
178
179 while ((tagname = rpmtdNextString(names))) {
when treating unknown const char * from rpmmodule.c:179 as non-NULL
taking True path
180 shortname = tagname + strlen("RPMTAG_");
181 tagval = rpmTagGetValue(shortname);
182
183 PyModule_AddIntConstant(module, tagname, tagval);
when PyModule_AddIntConstant() succeeds
184 pyval = PyInt_FromLong(tagval);
when PyInt_FromLong() succeeds
185 pyname = Py_BuildValue("s", shortname);
when Py_BuildValue() fails
186 PyDict_SetItem(dict, pyval, pyname);
calling PyDict_SetItem with NULL as argument 3 (pyname) at rpmmodule.c:186
PyDict_SetItem() invokes Py_INCREF() on the pointer, thus accessing (NULL)->ob_refcnt
187 Py_DECREF(pyval);
188 Py_DECREF(pyname);
189 }
190 PyModule_AddObject(module, "tagnames", dict);
191 rpmtdFreeData(names);
192 rpmtdFree(names);
193 }
File: | rpmmodule.c |
Function: | addRpmTags |
Error: | calling PyDict_SetItem with NULL as argument 2 (pyval) at rpmmodule.c:186 |
170 */
171 static void addRpmTags(PyObject *module)
172 {
173 PyObject *pyval, *pyname, *dict = PyDict_New();
when PyDict_New() succeeds
174 rpmtd names = rpmtdNew();
175 rpmTagGetNames(names, 1);
176 const char *tagname, *shortname;
177 rpmTagVal tagval;
178
179 while ((tagname = rpmtdNextString(names))) {
when treating unknown const char * from rpmmodule.c:179 as non-NULL
taking True path
180 shortname = tagname + strlen("RPMTAG_");
181 tagval = rpmTagGetValue(shortname);
182
183 PyModule_AddIntConstant(module, tagname, tagval);
when PyModule_AddIntConstant() succeeds
184 pyval = PyInt_FromLong(tagval);
when PyInt_FromLong() fails
185 pyname = Py_BuildValue("s", shortname);
when Py_BuildValue() succeeds
186 PyDict_SetItem(dict, pyval, pyname);
calling PyDict_SetItem with NULL as argument 2 (pyval) at rpmmodule.c:186
PyDict_SetItem() invokes Py_TYPE() on the pointer via the PyString_CheckExact() macro, thus accessing (NULL)->ob_type
found 1 similar trace(s) to this
187 Py_DECREF(pyval);
188 Py_DECREF(pyname);
189 }
190 PyModule_AddObject(module, "tagnames", dict);
191 rpmtdFreeData(names);
192 rpmtdFree(names);
193 }