[vlc-commits] fix handle leaks on RegOpenKeyEx
Sébastien Escudier
git at videolan.org
Wed Feb 8 15:31:01 CET 2012
vlc/vlc-2.0 | branch: master | Sébastien Escudier <sebastien-devel at celeos.eu> | Wed Feb 8 13:59:24 2012 +0100| [5faca1b8bf6c0e30804f462d7a7c64cd62a33e8d] | committer: Sébastien Escudier
fix handle leaks on RegOpenKeyEx
(cherry picked from commit f111847917894e8e5e832a5e2b850d229a4ceebc)
Signed-off-by: Sébastien Escudier <sebastien-devel at celeos.eu>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=5faca1b8bf6c0e30804f462d7a7c64cd62a33e8d
---
modules/access/http.c | 1 +
modules/text_renderer/freetype.c | 4 ++++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/modules/access/http.c b/modules/access/http.c
index 1389810..cc1ec82 100644
--- a/modules/access/http.c
+++ b/modules/access/http.c
@@ -449,6 +449,7 @@ static int OpenWithCookies( vlc_object_t *p_this, const char *psz_access,
}
else
msg_Dbg( p_access, "HTTP proxy disabled (MSIE)" );
+ RegCloseKey( h_key );
}
}
#else
diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index 5ec3b4d..364149b 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -589,7 +589,10 @@ static int GetFileFontByName( const char *font_name, char **psz_filename )
LONG i_result = RegEnumValueW( hKey, index, vbuffer, &vbuflen,
NULL, NULL, (LPBYTE)dbuffer, &dbuflen);
if( i_result != ERROR_SUCCESS )
+ {
+ RegCloseKey( hKey );
return i_result;
+ }
char *psz_value = FromWide( vbuffer );
@@ -617,6 +620,7 @@ static int GetFileFontByName( const char *font_name, char **psz_filename )
*psz_filename = FromWide( dbuffer );
free( font_name_temp );
+ RegCloseKey( hKey );
return 0;
}
More information about the vlc-commits
mailing list