Valgrind reports still reachable memory.
Martin <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi
I ran valgrind on the following simple program,
(no need for a loop, I only ran it once from the shell)
#include <fcgi_stdio.h>
int main()
{
FCGI_Accept();
FCGI_Finish();
return 0;
}
valgrind --show-reachable=yes --leak-check=full ./ex.fcgi
It says,
malloc/free: 1 allocs, 0 frees, 448 bytes allocated.
448 bytes in 1 blocks are still reachable in loss record 1 of 1
and it refers to OS_LibInit.
A look at the code shows that OS_LibInit is allocating the memory and
let asyncIoTable point to it. The memory is freed in OS_LibShutdown, but
that function is not called anywhere.
The allocation is protected by libInitialized so it's only made once. Of
course, when we have come this far we are exiting the program so it's
freed anyway. Still, when should this be freed?
/Martin
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/