freeradius-client thread safety & memleaks patch

Alex Massover alex at jajah.com
Mon Jul 26 10:47:37 CEST 2010


Hi,

The same like previous but bswap32() (in ip_utils.c) is properly wrapped in case GCC's __builtin_bswap32() is not available.

Please consider this one.


> -----Original Message-----
> From: freeradius-devel-bounces+alex=jajah.com at lists.freeradius.org
> [mailto:freeradius-devel-bounces+alex=jajah.com at lists.freeradius.org]
> On Behalf Of Alex Massover
> Sent: יום א 25 יולי 2010 12:30
> To: freeradius-devel at lists.freeradius.org
> Subject: freeradius-client thread safety & memleaks patch
> 
> Hello,
> 
> 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.
> 
> 
> Changes:
> 
> freeradius-client.h:
> 	- adding rad_hostent (will be used by ip_util.c)
> 	- changing functions signatures due to changes in ip_utils.c
> 
> avpair.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()
> 
> buildreq.c:
> 	- rc_get_id() is now simple, fast and reentrant.
> 
> config.c:
> 	- getservbyname_r() instead of getservbyname()
> 	- using rad_hostent in rc_gethostby*
> 	- fixing minor memleak - serv->secret[j] is not freed
> 
> ip_util.c:
> 	- 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()
> 
> sendserver.c:
> 	- using new rc_ip_hostname()
> 	- using rand_r() instead of rand()
> 
> 
> 
> --
> Best Regards,
> Alex Massover
> VoIP R&D TL
> Jajah Inc.
> 
> 
> 
> 
> 
> This mail was sent via Mail-SeCure System.
> 
> This mail was received via Mail-SeCure System.

This mail was sent via Mail-SeCure System.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: thread_safety.patch
Type: application/octet-stream
Size: 13945 bytes
Desc: thread_safety.patch
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20100726/5422f0b4/attachment.obj>


More information about the Freeradius-Devel mailing list