Changeset 81c68015ca4dd00cb35d1784040a48e5915c7989

Show
Ignore:
Timestamp:
05/31/08 17:13:43 (3 months ago)
Author:
Jean-Paul Saman <jpsaman@videolan.org>
git-committer:
Jean-Paul Saman <jpsaman@videolan.org> 1212246823 +0200
git-parent:

[222d90e0f1b6efc6421228392e02a3906680d5c7]

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

Fix CID 103: resource leak in EsOutAdd? and check malloc return values.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/input/es_out.c

    r1f75e57 r81c6801  
    184184    int i; 
    185185 
     186    if( !out ) return NULL; 
     187    if( !p_sys ) 
     188    { 
     189        free( out ); 
     190        return NULL; 
     191    } 
     192 
    186193    out->pf_add     = EsOutAdd; 
    187194    out->pf_send    = EsOutSend; 
     
    571578 
    572579    es_out_pgrm_t *p_pgrm = malloc( sizeof( es_out_pgrm_t ) ); 
     580    if( !p_pgrm ) return NULL; 
    573581 
    574582    /* Init */ 
     
    890898    int i; 
    891899 
     900    if( !es ) return NULL; 
     901 
    892902    if( fmt->i_group < 0 ) 
    893903    { 
    894904        msg_Err( p_input, "invalid group number" ); 
     905        free( es ); 
    895906        return NULL; 
    896907    }