What plants do you have in the tank you're trying to treat? It might be better to transfer the fish to a quarantine/hospital tank and treat it/them there.
In terms of chemically safer, Epsom salts (magnesium sulfate) are used as fertilizer all the time, where table salt is usually a big no-no. But the issue might be the actual salinity of the water interfering with the plants.
Also lots of invertebrates are very sensitive to sudden changes in salinity, so be careful if you have any that you're fond of.