[vlc-commits] commit: faad: fix potential memleak. ( Rémi Duraffort )

git at videolan.org git at videolan.org
Wed Jul 21 22:05:16 CEST 2010


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Jul 21 18:32:28 2010 +0200| [ab9825861e7e51408d1addb1f1e77fb03f900abf] | committer: Rémi Denis-Courmont 

faad: fix potential memleak.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ab9825861e7e51408d1addb1f1e77fb03f900abf
---

 modules/codec/faad.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/modules/codec/faad.c b/modules/codec/faad.c
index 7bda944..6d1c927 100644
--- a/modules/codec/faad.c
+++ b/modules/codec/faad.c
@@ -131,6 +131,7 @@ static int Open( vlc_object_t *p_this )
     if( ( p_sys->hfaad = faacDecOpen() ) == NULL )
     {
         msg_Err( p_dec, "cannot initialize faad" );
+        free( p_sys );
         return VLC_EGENERIC;
     }
 
@@ -158,6 +159,8 @@ static int Open( vlc_object_t *p_this )
                           &i_rate, &i_channels ) < 0 )
         {
             msg_Err( p_dec, "Failed to initialize faad using extra data" );
+            faacDecClose( p_sys->hfaad );
+            free( p_sys );
             return VLC_EGENERIC;
         }
 



More information about the vlc-commits mailing list