[vlc-devel] commit: Fix potential memleaks (CID 200) ( Rémi Duraffort )

git version control git at videolan.org
Fri Oct 10 01:45:21 CEST 2008


vlc | branch: 0.9-bugfix | Rémi Duraffort <ivoire at videolan.org> | Wed Oct  8 22:19:30 2008 +0200| [70fb43ae344db1ae3aa038b71757b59bcf2ebee8] | committer: Derk-Jan Hartman 

Fix potential memleaks (CID 200)
(cherry picked from commit aab61e71d3bc1fc36f2904e2150d4fc949f6af8b)

Signed-off-by: Derk-Jan Hartman <hartman at videolan.org>

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

 modules/access/dvb/en50221.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/access/dvb/en50221.c b/modules/access/dvb/en50221.c
index 9a24c1d..eaae14d 100644
--- a/modules/access/dvb/en50221.c
+++ b/modules/access/dvb/en50221.c
@@ -280,6 +280,8 @@ static int TPDURecv( access_t * p_access, uint8_t i_slot, uint8_t *pi_tag,
     if ( i_size < 5 )
     {
         msg_Err( p_access, "cannot read from CAM device (%d:%m)", i_size );
+        if( pi_size == NULL )
+            free( p_data );
         return VLC_EGENERIC;
     }
 
@@ -287,6 +289,8 @@ static int TPDURecv( access_t * p_access, uint8_t i_slot, uint8_t *pi_tag,
     {
         msg_Err( p_access, "invalid read from CAM device (%d instead of %d)",
                  p_data[1], i_tcid );
+        if( pi_size == NULL )
+            free( p_data );
         return VLC_EGENERIC;
     }
 
@@ -1828,7 +1832,7 @@ static int InitSlot( access_t * p_access, int i_slot )
             break;
         }
 
-        if ( TPDUSend( p_access, i_slot, T_CREATE_TC, NULL, 0 )
+        if ( TPDUSend( p_access, i_slot, T_CREATE_TC, NULL, NULL )
                 != VLC_SUCCESS )
         {
             msg_Err( p_access,
@@ -2024,7 +2028,7 @@ int en50221_Poll( access_t * p_access )
 
         if ( !p_sys->pb_tc_has_data[i_slot] )
         {
-            if ( TPDUSend( p_access, i_slot, T_DATA_LAST, NULL, 0 ) !=
+            if ( TPDUSend( p_access, i_slot, T_DATA_LAST, NULL, NULL ) !=
                     VLC_SUCCESS )
             {
                 msg_Err( p_access,




More information about the vlc-devel mailing list