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

git version control git at videolan.org
Fri Oct 10 21:17:27 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Oct 10 21:17:11 2008 +0200| [3f7a89044c5732513ab2337bce0dd231b7ade97e] | committer: Rémi Duraffort 

Fix potential memleaks.

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

 modules/demux/playlist/sgimb.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/modules/demux/playlist/sgimb.c b/modules/demux/playlist/sgimb.c
index 9fc898a..0a331f5 100644
--- a/modules/demux/playlist/sgimb.c
+++ b/modules/demux/playlist/sgimb.c
@@ -211,6 +211,7 @@ static int ParseLine ( demux_t *p_demux, char *psz_line )
     if( !strncasecmp( psz_bol, "rtsp://", sizeof("rtsp://") - 1 ) )
     {
         /* We found the link, it was inside a sgiQTFileBegin */
+        free( p_sys->psz_uri );
         p_sys->psz_uri = strdup( psz_bol );
     }
     else if( !strncasecmp( psz_bol, "Stream=\"", sizeof("Stream=\"") - 1 ) )
@@ -230,31 +231,37 @@ static int ParseLine ( demux_t *p_demux, char *psz_line )
             psz_bol[2] = 's';
             psz_bol[3] = 'p';
         }
+        free( p_sys->psz_uri );
         p_sys->psz_uri = strdup( psz_bol );
     }
     else if( !strncasecmp( psz_bol, "sgiNameServerHost=", sizeof("sgiNameServerHost=") - 1 ) )
     {
         psz_bol += sizeof("sgiNameServerHost=") - 1;
+        free( p_sys->psz_server );
         p_sys->psz_server = strdup( psz_bol );
     }
     else if( !strncasecmp( psz_bol, "sgiMovieName=", sizeof("sgiMovieName=") - 1 ) )
     {
         psz_bol += sizeof("sgiMovieName=") - 1;
+        free( p_sys->psz_location );
         p_sys->psz_location = strdup( psz_bol );
     }
     else if( !strncasecmp( psz_bol, "sgiUserAccount=", sizeof("sgiUserAccount=") - 1 ) )
     {
         psz_bol += sizeof("sgiUserAccount=") - 1;
+        free( p_sys->psz_user );
         p_sys->psz_user = strdup( psz_bol );
     }
     else if( !strncasecmp( psz_bol, "sgiUserPassword=", sizeof("sgiUserPassword=") - 1 ) )
     {
         psz_bol += sizeof("sgiUserPassword=") - 1;
+        free( p_sys->psz_password );
         p_sys->psz_password = strdup( psz_bol );
     }
     else if( !strncasecmp( psz_bol, "sgiShowingName=", sizeof("sgiShowingName=") - 1 ) )
     {
         psz_bol += sizeof("sgiShowingName=") - 1;
+        free( p_sys->psz_name );
         p_sys->psz_name = strdup( psz_bol );
     }
     else if( !strncasecmp( psz_bol, "sgiFormatName=", sizeof("sgiFormatName=") - 1 ) )
@@ -266,6 +273,7 @@ static int ParseLine ( demux_t *p_demux, char *psz_line )
     else if( !strncasecmp( psz_bol, "sgiMulticastAddress=", sizeof("sgiMulticastAddress=") - 1 ) )
     {
         psz_bol += sizeof("sgiMulticastAddress=") - 1;
+        free( p_sys->psz_mcast_ip );
         p_sys->psz_mcast_ip = strdup( psz_bol );
     }
     else if( !strncasecmp( psz_bol, "sgiMulticastPort=", sizeof("sgiMulticastPort=") - 1 ) )




More information about the vlc-devel mailing list