Closed chipitsine closed 1 week ago
from my view there's bigger problem when local variables are returned out of a function. I wonder why coverity does not worry about it, I plan to have look at it later
On 27/10/2024 18:06, Ilya Shipitsin wrote:
from my view there's bigger problem when local variables are returned out of a function. I wonder why coverity does not worry about it, I plan to have look at it later
It would worry me as well if that was what was happening. I think I trust coverity less and less as time goes on.
the following is suspicious
but that code is there for ~15 years. If there were a problem, it must appear somehow. What makes me think my assumption (about returning local variables|) is wrong
@lurcher , can we merge it since it addresses leaks ?
I don't understand where the leak is. the local variables you mention, are pointers, they are set to point to allocated memory in the call to __get_attr, then the pointed to, allocated memory is returned in the returned allocated structure. Just where does the problem occur?
if NULL is returned, so con_p is leaked
Ahh, ok, I can see that. Will fix that.