Changeset cc6941a5134af40e0a41620215bf9efe8ab5ba94

Show
Ignore:
Timestamp:
06/14/08 23:40:46 (3 months ago)
Author:
Rémi Denis-Courmont <rdenis@simphalempin.com>
git-committer:
Rémi Denis-Courmont <rdenis@simphalempin.com> 1213479646 +0300
git-parent:

[8cb6c0e68064b2ec798487b81a97e01336d88cfd]

git-author:
Rémi Denis-Courmont <rdenis@simphalempin.com> 1213479574 +0300
Message:

Fix memory leak and error handling

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/codec/realvideo.c

    r8cb6c0e rcc6941a  
    275275    }; 
    276276 
    277     for( size_t i = 0; psz_paths[i]; i += strlen( psz_paths[i] ) + 1 ) 
    278     { 
    279         asprintf( &g_decode_path, "%s/drv4.so.6.0", psz_paths + i ); 
    280         if( (p_sys->rv_handle = load_syms_linux(p_dec, g_decode_path)) ) 
     277    for( size_t i = 0; psz_paths[i]; i += strlen( psz_paths + i ) + 1 ) 
     278    { 
     279        if( asprintf( &g_decode_path, "%s/drv4.so.6.0", psz_paths + i ) != -1 ) 
     280        { 
     281            p_sys->rv_handle = load_syms_linux(p_dec, g_decode_path); 
     282            free( g_decode_path ); 
     283        } 
     284        if( p_sys->rv_handle ) 
    281285        { 
    282286            b_so_opened = true; 
    283             free( g_decode_path ); 
    284287            break; 
    285288        } 
    286289 
    287         asprintf( &g_decode_path, "%s/drv3.so.6.0", psz_paths + i ); 
    288         if( (p_sys->rv_handle = load_syms_linux(p_dec, g_decode_path)) ) 
     290        if( asprintf( &g_decode_path, "%s/drv3.so.6.0", psz_paths + i ) != -1 ) 
     291        { 
     292            p_sys->rv_handle = load_syms_linux(p_dec, g_decode_path); 
     293            free( g_decode_path ); 
     294        } 
     295        if( p_sys->rv_handle ) 
    289296        { 
    290297            b_so_opened = true; 
    291             free( g_decode_path ); 
    292298            break; 
    293299        } 
    294300 
    295301        msg_Dbg( p_dec, "Cannot load real decoder library: %s", g_decode_path); 
    296         free( g_decode_path ); 
    297302    } 
    298303#endif