From 274a03f3d7dea1620d93b78d2d50e5c8915fe643 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Tue, 14 Jul 2009 13:03:01 +0000 Subject: Only get old accesslist value shortly before freeing it --- ot_accesslist.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ot_accesslist.c b/ot_accesslist.c index e57f09e..834cbec 100644 --- a/ot_accesslist.c +++ b/ot_accesslist.c @@ -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 ); } -- cgit v1.2.3