From 406a01541ce145dff8f05aaac963686c4b622924 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Duraffort?= Date: Sun, 8 Mar 2009 21:46:14 +0100 Subject: [PATCH] screen_win32: fix potential memleak and use DeleteDC instead of ReleaseDC. --- modules/access/screen/win32.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- 2.39.2