From 91f8a9a4a7dbb97f111fba1ce8b930913d5a6c3c Mon Sep 17 00:00:00 2001 From: Gildas Bazin Date: Tue, 19 Mar 2002 12:48:01 +0000 Subject: [PATCH] * fixed two memory leaks * fixed typo in waveout.c --- plugins/dvd/dvd_access.c | 4 +++- plugins/mpeg_vdec/vpar_pool.c | 7 ++++++- plugins/win32/waveout.c | 6 +++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/plugins/dvd/dvd_access.c b/plugins/dvd/dvd_access.c index c0ef18b23c..6ee115c971 100644 --- a/plugins/dvd/dvd_access.c +++ b/plugins/dvd/dvd_access.c @@ -8,7 +8,7 @@ * -dvd_udf to find files ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: dvd_access.c,v 1.9 2002/03/18 19:14:52 sam Exp $ + * $Id: dvd_access.c,v 1.10 2002/03/19 12:48:01 gbazin Exp $ * * Author: Stéphane Borel * @@ -789,6 +789,7 @@ static char * DVDParse( input_thread_t * p_input ) { intf_ErrMsg( "dvd error: cannot stat() device `%s' (%s)", psz_device, strerror(errno)); + free( psz_device ); return NULL; } @@ -797,6 +798,7 @@ static char * DVDParse( input_thread_t * p_input ) { intf_WarnMsg( 3, "input: DVD plugin discarded" " (not a valid block device)" ); + free( psz_device ); return NULL; } #endif diff --git a/plugins/mpeg_vdec/vpar_pool.c b/plugins/mpeg_vdec/vpar_pool.c index 4e8d025ea9..528271c4cb 100644 --- a/plugins/mpeg_vdec/vpar_pool.c +++ b/plugins/mpeg_vdec/vpar_pool.c @@ -2,7 +2,7 @@ * vpar_pool.c : management of the pool of decoder threads ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: vpar_pool.c,v 1.5 2001/12/30 07:09:56 sam Exp $ + * $Id: vpar_pool.c,v 1.6 2002/03/19 12:48:01 gbazin Exp $ * * Authors: Christophe Massiot * @@ -207,6 +207,11 @@ void vpar_EndPool( vpar_thread_t * p_vpar ) { int i; + for( i = 0; i < 12; i++ ) + { + free( p_vpar->pool.mb.p_idcts[i].pi_block ); + } + for( i = 0; i < p_vpar->pool.i_smp; i++ ) { int j; diff --git a/plugins/win32/waveout.c b/plugins/win32/waveout.c index 9aedf7df22..87133da889 100644 --- a/plugins/win32/waveout.c +++ b/plugins/win32/waveout.c @@ -2,7 +2,7 @@ * waveout.c : Windows waveOut plugin for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: waveout.c,v 1.4 2002/02/24 22:06:50 sam Exp $ + * $Id: waveout.c,v 1.5 2002/03/19 12:48:01 gbazin Exp $ * * Authors: Gildas Bazin * @@ -155,7 +155,7 @@ static int aout_SetFormat( aout_thread_t *p_aout ) if( (p_aout->p_sys->waveformat.nChannels != p_aout->i_channels) || (p_aout->p_sys->waveformat.nSamplesPerSec != p_aout->i_rate) ) { - if( waveOutClose( p_aout->p_sys->h_waveout ) == MMSYSERR_NOERROR ) + if( waveOutClose( p_aout->p_sys->h_waveout ) != MMSYSERR_NOERROR ) { intf_ErrMsg( "aout error: waveOutClose failed" ); } @@ -252,7 +252,7 @@ static void aout_Close( aout_thread_t *p_aout ) intf_WarnMsg( 3, "aout: waveOut aout_Close "); /* Close the device */ - if( waveOutClose( p_aout->p_sys->h_waveout ) == MMSYSERR_NOERROR ) + if( waveOutClose( p_aout->p_sys->h_waveout ) != MMSYSERR_NOERROR ) { intf_ErrMsg( "aout error: waveOutClose failed" ); } -- 2.39.2