Errors seen in LOGS/rpm-4.9.1.2-12.fc17

This is a summary of errors seen when compiling with an experimental static analysis tool

Raw build logs can be seen here

Segfaults in normal paths

Code paths that will lead to a segmentatation fault

rpmfd-py.c rpmfdFromPyObject reading from deallocated memory at rpmfd-py.c:33: memory deallocated at rpmfd-py.c:32

Reference leaks

Code paths in which the reference count of an object is left too high, leading to memory leaks

header-py.c hdr_dsOfHeader ob_refcnt of new ref from call to Py_BuildValue is 1 too high
header-py.c hdr_fiFromHeader ob_refcnt of new ref from call to Py_BuildValue is 1 too high
rpmfd-py.c rpmfdFromPyObject ob_refcnt of new ref from call to Py_BuildValue is 1 too high
rpmmodule.c addRpmTags ob_refcnt of '*dict' is 1 too high
header-py.c hdr_dsFromHeader ob_refcnt of new ref from call to Py_BuildValue is 1 too high

Segfaults within error-handling paths

Code paths in error-handling that will lead to a segmentatation fault (e.g. under low memory conditions)

header-py.c hdr_dsOfHeader calling PyObject_Call with NULL as argument 2 (D.17741) at header-py.c:317
header-py.c hdrKeyList dereferencing NULL (to->ob_refcnt) at header-py.c:144
header-py.c hdrKeyList calling PyList_Append with NULL as argument 1 (keys) at header-py.c:143
header-py.c hdr_fiFromHeader calling PyObject_Call with NULL as argument 2 (D.17726) at header-py.c:297
rpmfd-py.c rpmfdFromPyObject calling PyObject_Call with NULL as argument 2 (D.15789) at rpmfd-py.c:26
rpmmodule.c addRpmTags calling PyDict_SetItem with NULL as argument 3 (pyname) at rpmmodule.c:186
rpmmodule.c addRpmTags calling PyDict_SetItem with NULL as argument 2 (pyval) at rpmmodule.c:186
header-py.c hdr_dsFromHeader calling PyObject_Call with NULL as argument 2 (D.17735) at header-py.c:311

Returning (PyObject*)NULL without setting an exception

These messages are often false-positives: the analysis tool has no knowledge about internal API calls that can lead to an exception being set
header-py.c rpmMergeHeadersFromFD returning (PyObject*)NULL without setting an exception
header-py.c hdr_subscript returning (PyObject*)NULL without setting an exception