File: header-py.c
Function: hdrKeyList
Error: dereferencing NULL (to->ob_refcnt) at header-py.c:144
134 static PyObject * hdrKeyList(hdrObject * s)
135 {
136     PyObject * keys = PyList_New(0);
137     HeaderIterator hi = headerInitIterator(s->h);
when PyList_New() succeeds
138     rpmTagVal tag;
139 
140     while ((tag = headerNextTag(hi)) != RPMTAG_NOT_FOUND) {
141 	PyObject *to = PyInt_FromLong(tag);
when considering range: -0x80000000 <= value <= -2
taking True path
142 	PyList_Append(keys, to);
when PyInt_FromLong() fails
143 	Py_DECREF(to);
returning -1 from PyList_Append() due to NULL item
144     }
dereferencing NULL (to->ob_refcnt) at header-py.c:144
found 1 similar trace(s) to this
145     headerFreeIterator(hi);
146 
147     return keys;
148 }
149 

File: header-py.c
Function: hdrKeyList
Error: calling PyList_Append with NULL as argument 1 (keys) at header-py.c:143
134 static PyObject * hdrKeyList(hdrObject * s)
135 {
136     PyObject * keys = PyList_New(0);
137     HeaderIterator hi = headerInitIterator(s->h);
when PyList_New() fails
138     rpmTagVal tag;
139 
140     while ((tag = headerNextTag(hi)) != RPMTAG_NOT_FOUND) {
141 	PyObject *to = PyInt_FromLong(tag);
when considering range: -0x80000000 <= value <= -2
taking True path
142 	PyList_Append(keys, to);
when PyInt_FromLong() succeeds
143 	Py_DECREF(to);
calling PyList_Append with NULL as argument 1 (keys) at header-py.c:143
PyList_Append() invokes Py_TYPE() on the pointer via the PyList_Check() macro, thus accessing (NULL)->ob_type
found 3 similar trace(s) to this
144     }
145     headerFreeIterator(hi);
146 
147     return keys;
148 }
149