mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 17:49:52 +01:00
Fix benc list/dict allocation.
This commit is contained in:
@@ -36,12 +36,13 @@ static int makeroom( benc_val_t * val, int count )
|
||||
|
||||
if( val->val.l.count + count <= val->val.l.alloc )
|
||||
{
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* We need a bigger boat */
|
||||
|
||||
len = val->val.l.alloc + count + ( count % LIST_SIZE ? 0 : LIST_SIZE );
|
||||
len = val->val.l.alloc + ( count / LIST_SIZE ) +
|
||||
( count % LIST_SIZE ? LIST_SIZE : 0 );
|
||||
new = realloc( val->val.l.vals, len * sizeof( benc_val_t ) );
|
||||
if( NULL == new )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user