Errors seen in LOGS/python-virtkey-0.50-11.fc17

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

Raw build logs can be seen here

Reference leaks

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

python-virtkey.c virtkey_layout_get_section_info ob_refcnt of PyIntObject is 1 too high
python-virtkey.c report_key_info ob_refcnt of PyStringObject is 1 too high
python-virtkey.c report_key_info ob_refcnt of '*labelTuple' is 1 too high
python-virtkey.c virtkey_layout_get_sections ob_refcnt of PyStringObject 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)

python-virtkey.c virtkey_get_labels_from_keycode_internal calling PyTuple_SetItem with NULL as argument 1 (labelTuple) at python-virtkey.c:430
python-virtkey.c virtkey_get_labels_from_keycode_internal calling PyTuple_SetItem with NULL as argument 1 (labelTuple) at python-virtkey.c:433
python-virtkey.c virtkey_layout_get_keys dereferencing NULL (MEM[(struct PyTupleObject *)keyTuple].ob_item) at python-virtkey.c:617
python-virtkey.c virtkey_layout_get_keys dereferencing NULL (MEM[(struct PyTupleObject *)rowTuple].ob_item) at python-virtkey.c:610
python-virtkey.c initvirtkey calling PyDict_SetItemString with NULL as argument 3 (virtkey_error.1) at python-virtkey.c:951
python-virtkey.c virtkey_layout_get_section_info calling PyTuple_Pack with NULL as argument 3 (height) at python-virtkey.c:568
python-virtkey.c virtkey_layout_get_section_info calling PyTuple_Pack with NULL as argument 2 (width) at python-virtkey.c:568
python-virtkey.c virtkey_get_layouts dereferencing NULL (MEM[(struct PyTupleObject *)tuple].ob_item) at python-virtkey.c:829
python-virtkey.c report_key_info calling PyDict_SetItemString with NULL as argument 3 (keycodeOb) at python-virtkey.c:515
python-virtkey.c virtkey_layout_get_sections calling PyTuple_SetItem with NULL as argument 1 (sectionTuple) at python-virtkey.c:654

Possible reference leaks

Code paths in which the reference count of an object might too large - but in which the reference in question came from a function not known to the analyzer.

The analyzer assumes such references are new references, but if the function returns a borrowed reference instead, it's probably not a bug

python-virtkey.c virtkey_new ob_refcnt of return value is 1 too high

Implementation notes for gcc-with-cpychecker

The following "Py" functions were used but aren't yet explicitly handled by gcc-with-cpychecker