Changeset 303e9b5405a9a4c0e9c428425a224d65797d6c18

Show
Ignore:
Timestamp:
03/08/08 19:42:19 (4 months ago)
Author:
Rémi Duraffort <ivoire@videolan.org>
git-committer:
Rémi Duraffort <ivoire@videolan.org> 1217785339 +0200
git-parent:

[9f15187610ae84720a88d2fd7b5a573fac706486]

git-author:
Rémi Duraffort <ivoire@videolan.org> 1217785339 +0200
Message:

Fix memleak and bad use of a const variable.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/misc/filter_chain.c

    r4db9842 r303e9b5  
    215215    config_chain_t *p_cfg = NULL; 
    216216    char *psz_name = NULL; 
     217    char* psz_new_string; 
    217218 
    218219    if( !psz_string || !*psz_string ) return 0; 
    219220 
    220     psz_string = config_ChainCreate( &psz_name, &p_cfg, psz_string ); 
     221    psz_new_string = config_ChainCreate( &psz_name, &p_cfg, psz_string ); 
    221222 
    222223    filter_t *p_filter = filter_chain_AppendFilterInternal( p_chain, psz_name, 
     
    228229        free( psz_name ); 
    229230        free( p_cfg ); 
     231        free( psz_new_string ); 
    230232        return -1; 
    231233    } 
    232234    free( psz_name ); 
    233235 
    234     int ret = filter_chain_AppendFromStringInternal( p_chain, psz_string ); 
     236    int ret = filter_chain_AppendFromStringInternal( p_chain, psz_new_string ); 
     237    free( psz_new_string ); 
    235238    if( ret < 0 ) 
    236239    {