From: RĂ©mi Duraffort Date: Sun, 8 Mar 2009 20:46:14 +0000 (+0100) Subject: screen_win32: fix potential memleak and use DeleteDC instead of ReleaseDC. X-Git-Tag: 1.0.0-pre1~186 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=406a01541ce145dff8f05aaac963686c4b622924;p=vlc screen_win32: fix potential memleak and use DeleteDC instead of ReleaseDC. --- diff --git a/modules/access/screen/win32.c b/modules/access/screen/win32.c index 3812393598..fd0adbc6f2 100644 --- a/modules/access/screen/win32.c +++ b/modules/access/screen/win32.c @@ -64,6 +64,7 @@ int screen_InitCapture( demux_t *p_demux ) if( !p_data->hdc_src ) { msg_Err( p_demux, "cannot get device context" ); + free( p_data ); return VLC_EGENERIC; } @@ -71,6 +72,7 @@ int screen_InitCapture( demux_t *p_demux ) if( !p_data->hdc_dst ) { msg_Err( p_demux, "cannot get compat device context" ); + free( p_data ); ReleaseDC( 0, p_data->hdc_src ); return VLC_EGENERIC; } @@ -90,8 +92,9 @@ int screen_InitCapture( demux_t *p_demux ) default: msg_Err( p_demux, "unknown screen depth %i", p_sys->fmt.video.i_bits_per_pixel ); + DeleteDC( p_data->hdc_dst ); ReleaseDC( 0, p_data->hdc_src ); - ReleaseDC( 0, p_data->hdc_dst ); + free( p_data ); return VLC_EGENERIC; }