Malachite green is used to treat certain kinds of infections in fish .