A judge approved a settlement of lawsuits against the world’s second-largest music label that gives millions of consumers free song downloads to compensate them for flawed anti-piracy software on compact discs.

With the settlement, the label, Sony BMG Music Entertainment, will stop manufacturing CD software that can leave computers vulnerable to hackers.