1
0
mirror of git://erdgeist.org/opentracker synced 2025-01-14 00:40:09 +00:00

Only get old accesslist value shortly before freeing it

This commit is contained in:
erdgeist 2009-07-14 13:03:01 +00:00
parent a9c25b9fed
commit 274a03f3d7

View File

@ -51,7 +51,7 @@ static void accesslist_readfile( int sig ) {
FILE * accesslist_filehandle;
ot_hash infohash;
ot_vector accesslist_tmp;
void *olddata = accesslist.data;
void *olddata;
char inbuf[512];
if( sig != SIGHUP ) return;
@ -89,6 +89,7 @@ static void accesslist_readfile( int sig ) {
/* Now exchange the accesslist vector in the least race condition prone way */
accesslist.size = 0;
olddata = accesslist.data;
memcpy( &accesslist, &accesslist_tmp, sizeof( &accesslist_tmp ));
free( olddata );
}