Open dvarrazzo opened 7 years ago
I keep on tripping on this error. @davidmalcolm could you please give me your opinion about this problem? I believe in the past passing ownership to the object state was recognised, whereas now it is reported that nothing references the object. Is this a regression and can it be fixed easily?
Examples are such as this function resulting in the following trace:
Hello David, I'm here again checking psycopg with your invaluable tool! I'm using the master branch (7ae141068774ab2892287bd8c2e84cee76e6fae7).
It seems to me the static analysis tool is not detecting correctly the association of objects to structures attribute. For instance in this simple case:
https://github.com/psycopg/psycopg2/blob/a2b01cdf/psycopg/adapter_asis.c#L102
which can be simplified to:
the checker thinks we are leaking a reference to obj, whereas we have assigned ownership to self:
If I "inlne" the assignment into the
asis_init()
function instead no error is reported.Am I doing something wrong or is it a bug?