Commit a65b3524 authored by Gildas Bazin's avatar Gildas Bazin

* modules/demux/real.c, modules/access/rtsp: fixed a bunch of memory leaks.

parent 2fe8bace
......@@ -2,7 +2,7 @@
* access.c: Real rtsp input
*****************************************************************************
* Copyright (C) 2005 VideoLAN
* $Id: file.c 10310 2005-03-11 22:36:40Z anil $
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
*
......@@ -220,6 +220,7 @@ static int Open( vlc_object_t *p_this )
p_sys->p_header = block_New( p_access, 4096 );
p_sys->p_header->i_buffer =
rmff_dump_header( h, p_sys->p_header->p_buffer, 1024 );
rmff_free_header( h );
}
else
{
......@@ -231,6 +232,7 @@ static int Open( vlc_object_t *p_this )
var_Create( p_access, "realrtsp-caching",
VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
if( psz_server ) free( psz_server );
return VLC_SUCCESS;
error:
......
......@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* $Id: asmrp.c,v 1.8 2004/08/27 18:34:16 miguelfreitas Exp $
* $Id$
*
* a parser for real's asm rules
*
......@@ -94,6 +94,7 @@ static asmrp_t *asmrp_new () {
p->sym_tab_num = 0;
p->sym = ASMRP_SYM_NONE;
p->buf = 0;
return p;
}
......@@ -105,6 +106,7 @@ static void asmrp_dispose (asmrp_t *p) {
for (i=0; i<p->sym_tab_num; i++)
free (p->sym_tab[i].id);
if (p->buf) free (p->buf);
free (p);
}
......
......@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* $Id: sdpplin.c,v 1.5 2004/04/23 21:59:04 miguelfreitas Exp $
* $Id$
*
* sdp/sdpplin parser.
*
......@@ -313,9 +313,10 @@ void sdpplin_free(sdpplin_t *description) {
if( description->stream[i]->mlti_data ) free( description->stream[i]->mlti_data );
if( description->stream[i]->rmff_flags ) free( description->stream[i]->rmff_flags );
if( description->stream[i]->asm_rule_book ) free( description->stream[i]->asm_rule_book );
free( description->stream[i] );
}
}
free( description->stream );
if( description->stream_count ) free( description->stream );
if( description->owner ) free( description->owner );
if( description->session_name ) free( description->session_name );
......
......@@ -4,7 +4,7 @@
*****************************************************************************
* Copyright (C) 2002-2004 the xine project
* Copyright (C) 2005 VideoLAN
* $Id: file.c 10310 2005-03-11 22:36:40Z anil $
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
* Adapted from xine which itself adapted it from joschkas real tools.
......@@ -239,8 +239,7 @@ static int rtsp_get_answers( rtsp_client_t *rtsp )
char *buf = malloc( strlen(answer) );
sscanf( answer, "%*s %s", buf );
if( rtsp->p_private->server ) free( rtsp->p_private->server );
rtsp->p_private->server = strdup( buf );
free( buf );
rtsp->p_private->server = buf;
}
if( !strncasecmp( answer, "Session:", 8 ) )
{
......@@ -433,6 +432,7 @@ int rtsp_read_data( rtsp_client_t *rtsp, char *buffer, unsigned int size )
sprintf( rest,"CSeq: %u", seq );
rtsp_put( rtsp, rest );
rtsp_put( rtsp, "" );
free( rest );
rtsp->pf_read( rtsp->p_userdata, buffer, size );
}
else
......@@ -514,6 +514,7 @@ int rtsp_connect( rtsp_client_t *rtsp, const char *psz_mrl,
if( s->port < 0 || s->port > 65535 ) s->port = 554;
}
free( mrl_ptr );
fprintf( stderr, "got mrl: %s %i %s\n", s->host, s->port, s->path );
s->s = rtsp->pf_connect( rtsp->p_userdata, s->host, s->port );
......@@ -561,6 +562,7 @@ void rtsp_close( rtsp_client_t *rtsp )
if( rtsp->p_private->mrl ) free( rtsp->p_private->mrl );
if( rtsp->p_private->session ) free( rtsp->p_private->session );
if( rtsp->p_private->user_agent ) free( rtsp->p_private->user_agent );
if( rtsp->p_private->server ) free( rtsp->p_private->server );
rtsp_free_answers( rtsp );
rtsp_unschedule_all( rtsp );
free( rtsp->p_private );
......
......@@ -146,18 +146,12 @@ static void Close( vlc_object_t *p_this )
{
real_track_t *tk = p_sys->track[i];
if( tk->p_frame )
{
block_Release( tk->p_frame );
}
if( tk->p_frame ) block_Release( tk->p_frame );
es_format_Clean( &tk->fmt );
free( tk );
}
if( p_sys->i_track > 0 )
{
free( p_sys->track );
}
if( p_sys->i_track > 0 ) free( p_sys->track );
free( p_sys );
}
......@@ -218,10 +212,7 @@ static int Demux( demux_t *p_demux )
for( i = 0; i < p_sys->i_track; i++ )
{
if( p_sys->track[i]->i_id == i_id )
{
tk = p_sys->track[i];
}
if( p_sys->track[i]->i_id == i_id ) tk = p_sys->track[i];
}
if( tk == NULL )
......
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