mirror of
git://erdgeist.org/opentracker
synced 2025-02-10 14:06:26 +00: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 */
|
for the maximum amount of them */
|
||||||
accesslist_new->size = 0;
|
accesslist_new->size = 0;
|
||||||
info_hash = accesslist_new->list = malloc( ( maplen / 41 ) * 20 );
|
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 );
|
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);
|
free(accesslist_new);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user