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

git at videolan.org git at videolan.org
Mon Jul 26 19:49:14 CEST 2010


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

faad: fix potential memleak.
(cherry picked from commit ab9825861e7e51408d1addb1f1e77fb03f900abf)

Signed-off-by: Rémi Duraffort <ivoire at videolan.org>

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

 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