]> git.sesse.net Git - vlc/commitdiff
Fix potential memleaks (CID 200)
authorRémi Duraffort <ivoire@videolan.org>
Wed, 8 Oct 2008 20:19:30 +0000 (22:19 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Wed, 8 Oct 2008 20:19:30 +0000 (22:19 +0200)
modules/access/dvb/en50221.c

index cf5a26ac8102611cfbe623c1c6aad61d63561bf3..5f14d67456534cf9b06567d63d9fba4de6144782 100644 (file)
@@ -285,6 +285,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;
     }
 
@@ -292,6 +294,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;
     }
 
@@ -1833,7 +1837,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,
@@ -2029,7 +2033,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,