Commit 97704de1 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

fix two memleaks and remove a bogus net_Close()

parent 4b9a9b5a
......@@ -260,8 +260,8 @@ struct announce_method_t
/* For SAP */
int i_ip_version;
char *psz_ipv6_scope;
char *psz_address; /* If we use a custom address */
char sz_ipv6_scope;
};
......
......@@ -184,7 +184,7 @@ void sout_AnnounceSessionDestroy( session_descriptor_t *p_session )
FREE( p_session->psz_group );
FREE( p_session->psz_uri );
FREE( p_session->psz_sdp );
FREE( p_session );
free( p_session );
}
}
......@@ -208,7 +208,7 @@ announce_method_t * sout_AnnounceMethodCreate( int i_type )
/* Default values */
p_method->psz_address = NULL;
p_method->i_ip_version = 4 ;
p_method->psz_ipv6_scope = strdup("8");
p_method->sz_ipv6_scope = '\0';
}
}
return p_method;
......
......@@ -248,9 +248,9 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
if( p_method->i_ip_version == 6 )
{
char sz_scope;
if( p_method->psz_ipv6_scope != NULL )
if( p_method->sz_ipv6_scope )
{
sz_scope = *p_method->psz_ipv6_scope;
sz_scope = p_method->sz_ipv6_scope;
}
else
{
......@@ -318,6 +318,7 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
p_address->b_enabled = VLC_TRUE;
p_address->b_ready = VLC_TRUE;
p_address->i_interval = config_GetInt( p_sap,"sap-interval");
p_address->i_rfd = -1;
}
if( p_address->i_wfd == -1 || (p_address->i_rfd == -1
......@@ -435,6 +436,10 @@ static int announce_SAPAnnounceDel( sap_handler_t *p_sap,
REMOVE_ELEM( p_sap->pp_sessions,
p_sap->i_sessions,
i );
FREE( p_session->p_sap->psz_sdp );
FREE( p_session->p_sap->psz_data );
free( p_session->p_sap );
break;
}
}
......
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