Skip to content
Snippets Groups Projects
Commit d91e3439 authored by Romain Vimont's avatar Romain Vimont Committed by Hugo Beauzée-Luyssen
Browse files

mtp: fix leak on error

parent 20b82357
No related branches found
No related tags found
1 merge request!945services discovery: mtp: rework implementation
...@@ -219,6 +219,12 @@ static int AddDevice( services_discovery_t *p_sd, ...@@ -219,6 +219,12 @@ static int AddDevice( services_discovery_t *p_sd,
sizeof( input_item_t * ) ) ) ) sizeof( input_item_t * ) ) ) )
{ {
free( psz_name ); free( psz_name );
while ( p_track ) {
p_tmp = p_track;
p_track = p_track->next;
LIBMTP_destroy_track_t( p_tmp );
}
LIBMTP_Release_Device( p_device );
return VLC_ENOMEM; return VLC_ENOMEM;
} }
p_sys->i_count = 0; p_sys->i_count = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment