summaryrefslogtreecommitdiff
path: root/ot_accesslist.c
diff options
context:
space:
mode:
authorerdgeist <>2009-07-14 13:03:01 +0000
committererdgeist <>2009-07-14 13:03:01 +0000
commit274a03f3d7dea1620d93b78d2d50e5c8915fe643 (patch)
tree631611c8cd5d7ff64ac8d7165b7f6ea244ee088d /ot_accesslist.c
parenta9c25b9fed0b245496a40937ec343fa306dc252e (diff)
Only get old accesslist value shortly before freeing it
Diffstat (limited to 'ot_accesslist.c')
-rw-r--r--ot_accesslist.c3
1 files changed, 2 insertions, 1 deletions
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 ) {
51 FILE * accesslist_filehandle; 51 FILE * accesslist_filehandle;
52 ot_hash infohash; 52 ot_hash infohash;
53 ot_vector accesslist_tmp; 53 ot_vector accesslist_tmp;
54 void *olddata = accesslist.data; 54 void *olddata;
55 char inbuf[512]; 55 char inbuf[512];
56 56
57 if( sig != SIGHUP ) return; 57 if( sig != SIGHUP ) return;
@@ -89,6 +89,7 @@ static void accesslist_readfile( int sig ) {
89 89
90 /* Now exchange the accesslist vector in the least race condition prone way */ 90 /* Now exchange the accesslist vector in the least race condition prone way */
91 accesslist.size = 0; 91 accesslist.size = 0;
92 olddata = accesslist.data;
92 memcpy( &accesslist, &accesslist_tmp, sizeof( &accesslist_tmp )); 93 memcpy( &accesslist, &accesslist_tmp, sizeof( &accesslist_tmp ));
93 free( olddata ); 94 free( olddata );
94} 95}