Commit 8a18bfd9 authored by Clément Stenac's avatar Clément Stenac

Fix memleaks

parent 18207216
......@@ -355,6 +355,9 @@ static int Open( vlc_object_t *p_this )
p_stream->p_sys->p_session = p_session;
}
vlc_UrlClean( &url );
if( p_method->psz_address) free( p_method->psz_address );
free( p_method );
}
/* *** Register with slp *** */
......@@ -402,6 +405,7 @@ static int Open( vlc_object_t *p_this )
if( psz_mux ) free( psz_mux );
if( psz_url ) free( psz_url );
return VLC_SUCCESS;
}
......@@ -417,6 +421,7 @@ static void Close( vlc_object_t * p_this )
if( p_sys->p_session != NULL )
{
sout_AnnounceUnRegister( p_stream->p_sout, p_sys->p_session );
sout_AnnounceSessionDestroy( p_sys->p_session );
}
#ifdef HAVE_SLP_H
......
......@@ -250,7 +250,7 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
{
/* IPv4 */
p_method->psz_address = (char*)malloc( 15*sizeof(char) );
sprintf(p_method->psz_address, SAP_IPV4_ADDR );
snprintf(p_method->psz_address, 15, SAP_IPV4_ADDR );
}
}
msg_Dbg( p_sap, "using SAP address: %s",p_method->psz_address);
......@@ -386,6 +386,8 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
memcpy( p_sap_session->psz_data+i_header_size, p_sap_session->psz_sdp,
strlen( p_sap_session->psz_sdp) );
free( psz_head );
/* Enqueue the announce */
INSERT_ELEM( p_sap->pp_sessions,
p_sap->i_sessions,
......@@ -425,7 +427,7 @@ static int announce_SAPAnnounceDel( sap_handler_t *p_sap,
/* XXX: Dequeue the address too if it is not used anymore
* TODO: - address refcount
- send a SAP deletion packet */
- send a SAP deletion packet */
msg_Dbg( p_sap,"%i announces remaining", p_sap->i_sessions );
......
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