Errors seen in LOGS/python-adns-1.2.1-9.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

adnsmodule.c _new_constant_class ob_refcnt of '*d' is 1 too high
adnsmodule.c _new_constant_class ob_refcnt of PyStringObject is 1 too high
adnsmodule.c _new_constant_class ob_refcnt of '*v' is 1 too high
adnsmodule.c ADNS_State_dealloc ob_refcnt of _Py_NoneStruct is 1 too high

Reference leak within initialization

Code paths in which the reference count of an object is left too high, but within an initialization routine, and thus likely to only happen once

adnsmodule.c _new_exception ob_refcnt of '*v' 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)

adnsmodule.c ADNS_State_submit dereferencing NULL (o->query) at adnsmodule.c:437
adnsmodule.c ADNS_State_submit_reverse dereferencing NULL (o->query) at adnsmodule.c:477
adnsmodule.c ADNS_Query_check dereferencing NULL (D.11880->ob_refcnt) at adnsmodule.c:802
adnsmodule.c ADNS_State_submit_reverse_any dereferencing NULL (o->query) at adnsmodule.c:517
adnsmodule.c ADNS_Query_wait dereferencing NULL (D.11845->ob_refcnt) at adnsmodule.c:853
adnsmodule.c interpret_hostaddr dereferencing NULL (addrs->ob_refcnt) at adnsmodule.c:181
adnsmodule.c interpret_hostaddr dereferencing NULL (MEM[(struct PyTupleObject *)addrs].ob_item) at adnsmodule.c:174

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

adnsmodule.c ADNS_State_submit ob_refcnt of '*o' is 1 too high
adnsmodule.c ADNS_State_submit_reverse ob_refcnt of '*o' is 1 too high
adnsmodule.c ADNS_Query_check ob_refcnt of return value is 1 too high
adnsmodule.c ADNS_State_submit_reverse_any ob_refcnt of '*o' is 1 too high
adnsmodule.c _new_constant_class ob_refcnt of '*c' is 1 too high
adnsmodule.c ADNS_Query_wait ob_refcnt of return value is 1 too high
adnsmodule.c adns__init ob_refcnt of '*s' is 1 too high

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
adnsmodule.c ADNS_Query_check returning (PyObject*)NULL without setting an exception
adnsmodule.c ADNS_Query_wait returning (PyObject*)NULL without setting an exception