mirror of
https://github.com/transmission/transmission
synced 2025-03-12 07:03:44 +00:00
Fix benc list allocations for like the fourth time.
Hopefully this time it actually works.
This commit is contained in:
parent
f89831fc66
commit
7d67c4b457
1 changed files with 2 additions and 3 deletions
|
@ -40,9 +40,8 @@ static int makeroom( benc_val_t * val, int count )
|
|||
}
|
||||
|
||||
/* We need a bigger boat */
|
||||
|
||||
len = val->val.l.alloc + ( count / LIST_SIZE ) +
|
||||
( count % LIST_SIZE ? LIST_SIZE : 0 );
|
||||
len = val->val.l.alloc + count +
|
||||
( count % LIST_SIZE ? LIST_SIZE - ( count % LIST_SIZE ) : 0 );
|
||||
new = realloc( val->val.l.vals, len * sizeof( benc_val_t ) );
|
||||
if( NULL == new )
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue