Fixed a memory leak for real multi-dimensional transforms.

Fixed a memory leak valgrind found while I was trying to track down the cause of issue #5