How to check my eap method for memory leak

Jouni Malinen j at w1.fi
Tue Jul 29 16:39:07 EDT 2014


On Tue, Jul 29, 2014 at 08:39:41AM +0300, khali singh wrote:
> I have now a working new EAP method that satifies my needs. But giving my
> coding skills, I want to know if there are memory leaks. IS there some easy
> to use tool for this. I have some experience with valgrind. But my hostapd
> should never stop running. Only at the end of an eap run, successful or
> unsuccessful, all the memory should be released. Is there some easy way out?

hostapd does not use per-EAP session memory allocation mechanism, so it
would be difficult to do that without stopping the process. I would just
run an authentication run (or few) and stop the process to check for
memory leaks. If you are using the os_*alloc functions, you can use
internal memory allocation validation code (CONFIG_WPA_TRACE=y) to get
list of memory leaks when the process exists. valgring is also a pretty
convenient way of doing this.

-- 
Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list