Commit 4974f83a authored by Jean-Paul Saman's avatar Jean-Paul Saman

Another bunch of memory leaks in realrtsp plugin

parent 036c9c52
...@@ -315,7 +315,7 @@ sdpplin_t *sdpplin_parse(char *data) ...@@ -315,7 +315,7 @@ sdpplin_t *sdpplin_parse(char *data)
int len=strchr(data,'\n')-data; int len=strchr(data,'\n')-data;
memcpy(buf, data, len+1); memcpy(buf, data, len+1);
buf[len]=0; buf[len]=0;
printf("libreal: sdpplin: not handled: '%s'\n", buf); printf("libreal: sdpplin: not handled: '%s'\n", buf);
#endif #endif
data=nl(data); data=nl(data);
} }
...@@ -328,6 +328,43 @@ sdpplin_t *sdpplin_parse(char *data) ...@@ -328,6 +328,43 @@ sdpplin_t *sdpplin_parse(char *data)
void sdpplin_free(sdpplin_t *description) void sdpplin_free(sdpplin_t *description)
{ {
/* TODO: free strings */ int i;
free(description);
if( !description ) return;
for( i=0; i<description->stream_count; i++ )
{
if( description->stream[i] )
{
if( description->stream[i]->id ) free( description->stream[i]->id );
if( description->stream[i]->bandwidth ) free( description->stream[i]->bandwidth );
if( description->stream[i]->range ) free( description->stream[i]->range );
if( description->stream[i]->length ) free( description->stream[i]->length );
if( description->stream[i]->rtpmap ) free( description->stream[i]->rtpmap );
if( description->stream[i]->mimetype ) free( description->stream[i]->mimetype );
if( description->stream[i]->stream_name ) free( description->stream[i]->stream_name );
if( description->stream[i]->mime_type ) free( description->stream[i]->mime_type );
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 );
if( description->owner ) free( description->owner );
if( description->session_name ) free( description->session_name );
if( description->session_info ) free( description->session_info );
if( description->uri ) free( description->uri );
if( description->email ) free( description->email );
if( description->phone ) free( description->phone );
if( description->connection ) free( description->connection );
if( description->bandwidth ) free( description->bandwidth );
if( description->title ) free( description->title );
if( description->author ) free( description->author );
if( description->copyright ) free( description->copyright );
if( description->keywords ) free( description->keywords );
if( description->asm_rule_book ) free( description->asm_rule_book );
if( description->abstract ) free( description->abstract );
if( description->range ) free( description->range );
free(description);
} }
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