[vlc-commits] fix handle leaks on RegOpenKeyEx
Sébastien Escudier
git at videolan.org
Wed Feb 8 14:00:27 CET 2012
vlc | branch: master | Sébastien Escudier <sebastien-devel at celeos.eu> | Wed Feb 8 13:59:24 2012 +0100| [f111847917894e8e5e832a5e2b850d229a4ceebc] | committer: Sébastien Escudier
fix handle leaks on RegOpenKeyEx
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f111847917894e8e5e832a5e2b850d229a4ceebc
---
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 b52b045..795f00b 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -588,7 +588,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 );
@@ -616,6 +619,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