Commit 3f7a8904 authored by Rémi Duraffort's avatar Rémi Duraffort

Fix potential memleaks.

parent 74d28b3e
...@@ -211,6 +211,7 @@ static int ParseLine ( demux_t *p_demux, char *psz_line ) ...@@ -211,6 +211,7 @@ static int ParseLine ( demux_t *p_demux, char *psz_line )
if( !strncasecmp( psz_bol, "rtsp://", sizeof("rtsp://") - 1 ) ) if( !strncasecmp( psz_bol, "rtsp://", sizeof("rtsp://") - 1 ) )
{ {
/* We found the link, it was inside a sgiQTFileBegin */ /* We found the link, it was inside a sgiQTFileBegin */
free( p_sys->psz_uri );
p_sys->psz_uri = strdup( psz_bol ); p_sys->psz_uri = strdup( psz_bol );
} }
else if( !strncasecmp( psz_bol, "Stream=\"", sizeof("Stream=\"") - 1 ) ) else if( !strncasecmp( psz_bol, "Stream=\"", sizeof("Stream=\"") - 1 ) )
...@@ -230,31 +231,37 @@ static int ParseLine ( demux_t *p_demux, char *psz_line ) ...@@ -230,31 +231,37 @@ static int ParseLine ( demux_t *p_demux, char *psz_line )
psz_bol[2] = 's'; psz_bol[2] = 's';
psz_bol[3] = 'p'; psz_bol[3] = 'p';
} }
free( p_sys->psz_uri );
p_sys->psz_uri = strdup( psz_bol ); p_sys->psz_uri = strdup( psz_bol );
} }
else if( !strncasecmp( psz_bol, "sgiNameServerHost=", sizeof("sgiNameServerHost=") - 1 ) ) else if( !strncasecmp( psz_bol, "sgiNameServerHost=", sizeof("sgiNameServerHost=") - 1 ) )
{ {
psz_bol += sizeof("sgiNameServerHost=") - 1; psz_bol += sizeof("sgiNameServerHost=") - 1;
free( p_sys->psz_server );
p_sys->psz_server = strdup( psz_bol ); p_sys->psz_server = strdup( psz_bol );
} }
else if( !strncasecmp( psz_bol, "sgiMovieName=", sizeof("sgiMovieName=") - 1 ) ) else if( !strncasecmp( psz_bol, "sgiMovieName=", sizeof("sgiMovieName=") - 1 ) )
{ {
psz_bol += sizeof("sgiMovieName=") - 1; psz_bol += sizeof("sgiMovieName=") - 1;
free( p_sys->psz_location );
p_sys->psz_location = strdup( psz_bol ); p_sys->psz_location = strdup( psz_bol );
} }
else if( !strncasecmp( psz_bol, "sgiUserAccount=", sizeof("sgiUserAccount=") - 1 ) ) else if( !strncasecmp( psz_bol, "sgiUserAccount=", sizeof("sgiUserAccount=") - 1 ) )
{ {
psz_bol += sizeof("sgiUserAccount=") - 1; psz_bol += sizeof("sgiUserAccount=") - 1;
free( p_sys->psz_user );
p_sys->psz_user = strdup( psz_bol ); p_sys->psz_user = strdup( psz_bol );
} }
else if( !strncasecmp( psz_bol, "sgiUserPassword=", sizeof("sgiUserPassword=") - 1 ) ) else if( !strncasecmp( psz_bol, "sgiUserPassword=", sizeof("sgiUserPassword=") - 1 ) )
{ {
psz_bol += sizeof("sgiUserPassword=") - 1; psz_bol += sizeof("sgiUserPassword=") - 1;
free( p_sys->psz_password );
p_sys->psz_password = strdup( psz_bol ); p_sys->psz_password = strdup( psz_bol );
} }
else if( !strncasecmp( psz_bol, "sgiShowingName=", sizeof("sgiShowingName=") - 1 ) ) else if( !strncasecmp( psz_bol, "sgiShowingName=", sizeof("sgiShowingName=") - 1 ) )
{ {
psz_bol += sizeof("sgiShowingName=") - 1; psz_bol += sizeof("sgiShowingName=") - 1;
free( p_sys->psz_name );
p_sys->psz_name = strdup( psz_bol ); p_sys->psz_name = strdup( psz_bol );
} }
else if( !strncasecmp( psz_bol, "sgiFormatName=", sizeof("sgiFormatName=") - 1 ) ) else if( !strncasecmp( psz_bol, "sgiFormatName=", sizeof("sgiFormatName=") - 1 ) )
...@@ -266,6 +273,7 @@ static int ParseLine ( demux_t *p_demux, char *psz_line ) ...@@ -266,6 +273,7 @@ static int ParseLine ( demux_t *p_demux, char *psz_line )
else if( !strncasecmp( psz_bol, "sgiMulticastAddress=", sizeof("sgiMulticastAddress=") - 1 ) ) else if( !strncasecmp( psz_bol, "sgiMulticastAddress=", sizeof("sgiMulticastAddress=") - 1 ) )
{ {
psz_bol += sizeof("sgiMulticastAddress=") - 1; psz_bol += sizeof("sgiMulticastAddress=") - 1;
free( p_sys->psz_mcast_ip );
p_sys->psz_mcast_ip = strdup( psz_bol ); p_sys->psz_mcast_ip = strdup( psz_bol );
} }
else if( !strncasecmp( psz_bol, "sgiMulticastPort=", sizeof("sgiMulticastPort=") - 1 ) ) else if( !strncasecmp( psz_bol, "sgiMulticastPort=", sizeof("sgiMulticastPort=") - 1 ) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment