Ignore:
Timestamp:
Feb 14, 2008, 1:12:00 AM (14 years ago)
Author:
charles
Message:

#706: save a little more memory by doing the same for tr_info.comment and tr_info.creator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/metainfo.c

    r5031 r5034  
    201201    if( NULL != val && TYPE_STR == val->type )
    202202    {
    203         strlcat_utf8( inf->comment, val->val.s.s, sizeof( inf->comment ), 0 );
     203        char buf[4096];
     204        memset( buf, 0, sizeof( buf ) );
     205        strlcat_utf8( buf, val->val.s.s, sizeof( buf ), 0 );
     206        tr_free( inf->comment );
     207        inf->comment = tr_strdup( buf );
    204208    }
    205209   
     
    208212    if( NULL != val && TYPE_STR == val->type )
    209213    {
    210         strlcat_utf8( inf->creator, val->val.s.s, sizeof( inf->creator ), 0 );
     214        char buf[4096];
     215        memset( buf, 0, sizeof( buf ) );
     216        strlcat_utf8( buf, val->val.s.s, sizeof( buf ), 0 );
     217        tr_free( inf->creator );
     218        inf->creator = tr_strdup( buf );
    211219    }
    212220   
     
    311319    tr_free( inf->pieces );
    312320    tr_free( inf->files );
     321    tr_free( inf->comment );
     322    tr_free( inf->creator );
    313323    tr_free( inf->primaryAddress );
    314324   
Note: See TracChangeset for help on using the changeset viewer.