mirror of
				git://erdgeist.org/opentracker
				synced 2025-11-04 11:53:22 +08:00 
			
		
		
		
	unmap file if a memory allocation error occurs
This commit is contained in:
		
							parent
							
								
									102ba9075b
								
							
						
					
					
						commit
						00bd3b2009
					
				@ -56,8 +56,9 @@ static void accesslist_readfile( void ) {
 | 
			
		||||
     for the maximum amount of them */
 | 
			
		||||
  accesslist_new->size = 0;
 | 
			
		||||
  info_hash = accesslist_new->list = malloc( ( maplen / 41 ) * 20 );
 | 
			
		||||
  if( !accesslist_new ) {
 | 
			
		||||
  if( !accesslist_new->list ) {
 | 
			
		||||
    fprintf( stderr, "Warning: Not enough memory to allocate %zd bytes for accesslist buffer. May succeed later.\n", ( maplen / 41 ) * 20 );
 | 
			
		||||
    mmap_unmap( map, maplen);
 | 
			
		||||
    free(accesslist_new);
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user