Commit e8a7a036 authored by François Cartegnie's avatar François Cartegnie 🤞

Qt: fix leak in plselector sd

parent a1526880
......@@ -366,11 +366,15 @@ void PLSelector::setSource( QTreeWidgetItem *item )
return ;
services_discovery_descriptor_t *p_test = new services_discovery_descriptor_t;
int i_ret = playlist_ServicesDiscoveryControl( THEPL, qtu( qs ), SD_CMD_DESCRIPTOR, p_test );
if ( i_ret != VLC_SUCCESS )
if( p_test )
{
if ( playlist_ServicesDiscoveryControl( THEPL, qtu( qs ),
SD_CMD_DESCRIPTOR, p_test ) == VLC_SUCCESS )
{
item->setData( 0, CAP_SEARCH_ROLE, (p_test->i_capabilities & SD_CAP_SEARCH) );
}
delete p_test;
else if ( p_test->i_capabilities & SD_CAP_SEARCH )
item->setData( 0, CAP_SEARCH_ROLE, true );
}
}
}
......
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