Changeset 1db9db8d0b364396bddde04728c8adb7b70c7d6b

Show
Ignore:
Timestamp:
04/12/05 20:35:35 (3 years ago)
Author:
Gildas Bazin <gbazin@videolan.org>
git-committer:
Gildas Bazin <gbazin@videolan.org> 1133724935 +0000
git-parent:

[0d26b16638421761d2719a082c110cd1b8a3903b]

git-author:
Gildas Bazin <gbazin@videolan.org> 1133724935 +0000
Message:

* modules/audio_output/alsa.c: fixed minor memory leak.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/audio_output/alsa.c

    rbc3de76 r1db9db8  
    316316    p_sys->b_playing = VLC_FALSE; 
    317317    p_sys->start_date = 0; 
    318     p_sys->p_status = (snd_pcm_status_t *)malloc(snd_pcm_status_sizeof()); 
    319318    vlc_cond_init( p_aout, &p_sys->wait ); 
    320319    vlc_mutex_init( p_aout, &p_sys->lock ); 
     
    327326        return VLC_EGENERIC; 
    328327    } 
     328 
     329    p_sys->p_status = (snd_pcm_status_t *)malloc(snd_pcm_status_sizeof()); 
    329330 
    330331    /* Choose the IEC device for S/PDIF output: 
     
    376377    if ( var_Get( p_aout, "audio-device", &val ) < 0 ) 
    377378    { 
     379        free( p_sys->p_status ); 
    378380        free( p_sys ); 
    379381        free( psz_device ); 
     
    412414        /* This should not happen ! */ 
    413415        msg_Err( p_aout, "internal: can't find audio-device (%i)", val.i_int ); 
     416        free( p_sys->p_status ); 
    414417        free( p_sys ); 
    415418        free( psz_device ); 
     
    429432            msg_Err( p_aout, "cannot open ALSA device `%s' (%s)", 
    430433                             psz_iec_device, snd_strerror( i_snd_rc ) ); 
     434            free( p_sys->p_status ); 
    431435            free( p_sys ); 
    432436            free( psz_device ); 
     
    471475            msg_Err( p_aout, "cannot open ALSA device `%s' (%s)", 
    472476                             psz_device, snd_strerror( i_snd_rc ) ); 
     477            free( p_sys->p_status ); 
    473478            free( p_sys ); 
    474479            free( psz_device ); 
     
    674679    snd_output_close( p_sys->p_snd_stderr ); 
    675680#endif 
     681    free( p_sys->p_status ); 
    676682    free( p_sys ); 
    677683    return VLC_EGENERIC;