What is the best medicine for nocturnal leg cramps in the elderly?

There are no medications safe enough to treat nocturnal leg cramps, and if secondary to an underlying condition, the primary condition should be treated aggressively.