[vlc-devel] commit: Potential memleak. ( Rémi Duraffort )
git version control
git at videolan.org
Thu Jul 31 22:06:43 CEST 2008
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Jul 31 21:55:53 2008 +0200| [be68773052b3b440f3274b1164fb07b22d147a59]
Potential memleak.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=be68773052b3b440f3274b1164fb07b22d147a59
---
modules/codec/fake.c | 3 +++
modules/control/http/http.c | 1 +
modules/control/lirc.c | 2 ++
3 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/modules/codec/fake.c b/modules/codec/fake.c
index 7696a76..bd4c1cd 100644
--- a/modules/codec/fake.c
+++ b/modules/codec/fake.c
@@ -154,6 +154,7 @@ static int OpenDecoder( vlc_object_t *p_this )
if( !psz_file )
{
msg_Err( p_dec, "specify a file with --fake-file=..." );
+ free( p_dec->p_sys );
return VLC_EGENERIC;
}
var_AddCallback( p_dec, "fake-file", FakeCallback, p_dec );
@@ -222,6 +223,8 @@ static int OpenDecoder( vlc_object_t *p_this )
if ( p_image == NULL )
{
msg_Err( p_dec, "unable to read image file %s", psz_file );
+ free( psz_file );
+ free( p_dec->p_sys );
return VLC_EGENERIC;
}
msg_Dbg( p_dec, "file %s loaded successfully", psz_file );
diff --git a/modules/control/http/http.c b/modules/control/http/http.c
index 54cce0b..1b1796a 100644
--- a/modules/control/http/http.c
+++ b/modules/control/http/http.c
@@ -142,6 +142,7 @@ static int Open( vlc_object_t *p_this )
p_intf->p_sys = p_sys = malloc( sizeof( intf_sys_t ) );
if( !p_intf->p_sys )
{
+ free( psz_address );
return( VLC_ENOMEM );
}
diff --git a/modules/control/lirc.c b/modules/control/lirc.c
index 1951c17..0ae6fbb 100644
--- a/modules/control/lirc.c
+++ b/modules/control/lirc.c
@@ -98,6 +98,7 @@ static int Open( vlc_object_t *p_this )
if( i_fd == -1 )
{
msg_Err( p_intf, "lirc initialisation failed" );
+ free( p_intf->p_sys->psz_file );
free( p_intf->p_sys );
return 1;
}
@@ -109,6 +110,7 @@ static int Open( vlc_object_t *p_this )
{
msg_Err( p_intf, "failure while reading lirc config" );
lirc_deinit();
+ free( p_intf->p_sys->psz_file );
free( p_intf->p_sys );
return 1;
}
More information about the vlc-devel
mailing list