freeradius-client thread safety & memleaks patch
alex at jajah.com
Sun Jul 25 11:29:50 CEST 2010
I want to sync changes I did to CVS. No new functionality only fixes for thread-safety and fixing memory leaks.
I use this code with static (shared among threads) rc_handle and experience no segfaults and no memory leaks :)
Some parts of this patch we posted before, but this one combines them all and is prepared against current CVS.
- adding rad_hostent (will be used by ip_util.c)
- changing functions signatures due to changes in ip_utils.c
- using localtime_r() instead of non-reentrant localtime()
- fixing minor memory leak posted by somebody else (not me) to this mail list, but not applied yet
- inet_ntoa() is not reentrant, using inet_ntop() instead
- gmtime_r() instead of gmtime()
- rc_get_id() is now simple, fast and reentrant.
- getservbyname_r() instead of getservbyname()
- using rad_hostent in rc_gethostby*
- fixing minor memleak - serv->secret[j] is not freed
- using rad_hostent instead of thread-local buffer. Thread local storage is tricky and might leak in thread per request scenario
- implementation of rc_ip_hostname() is copied from freeradius server. (something is wrong with current one)
- using getservbyname_r() instead of getservbyname()
- using new rc_ip_hostname()
- using rand_r() instead of rand()
VoIP R&D TL
This mail was sent via Mail-SeCure System.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 13568 bytes
More information about the Freeradius-Devel