Changeset f1558cbbe8321934cb368be637dbd21e1697804e

Show
Ignore:
Timestamp:
27/08/08 14:44:31 (3 months ago)
Author:
Jean-Paul Saman <jean-paul.saman@m2x.nl>
git-committer:
Jean-Paul Saman <jean-paul.saman@m2x.nl> 1219841071 +0200
git-parent:

[479a1cc214572c3519b8143efd2c42e2e56a2d6a]

git-author:
Jean-Paul Saman <jpsaman@videolan.org> 1218513072 +0800
Message:

Handle return value and fix memleaks.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/demux/demuxdump.c

    rf66626b rf1558cb  
    102102        return VLC_EGENERIC; 
    103103 
     104    p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) ); 
     105    if( !p_sys ) 
     106        return VLC_ENOMEM; 
     107 
    104108    var_Create( p_demux, "demuxdump-append", VLC_VAR_BOOL|VLC_VAR_DOINHERIT ); 
    105109    var_Get( p_demux, "demuxdump-append", &val ); 
     
    112116    p_demux->pf_demux = Demux; 
    113117    p_demux->pf_control = Control; 
    114     p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) ); 
     118 
    115119    p_sys->i_write = 0; 
    116120    p_sys->p_file = NULL; 
     
    119123    { 
    120124        msg_Warn( p_demux, "no dump file name given" ); 
     125        free( p_sys->psz_file ); 
     126        free( p_sys ); 
    121127        return VLC_EGENERIC; 
    122128    } 
     
    130136    { 
    131137        msg_Err( p_demux, "cannot create `%s' for writing", p_sys->psz_file ); 
    132  
     138        free( p_sys->psz_file ); 
    133139        free( p_sys ); 
    134140        return VLC_EGENERIC; 
     
    157163    } 
    158164    free( p_sys->psz_file ); 
    159  
    160165    free( p_sys ); 
    161166}