Index: /trunk/psLib/src/dataManip/psFFT.c
===================================================================
--- /trunk/psLib/src/dataManip/psFFT.c	(revision 1009)
+++ /trunk/psLib/src/dataManip/psFFT.c	(revision 1010)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-12 01:33:16 $
+ *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-12 02:17:25 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -35,4 +35,5 @@
     /* got good image data? */
     if (in==NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -43,4 +44,5 @@
         psError(__func__,"Input image must be a 32-bit float or complex image (type=%d)",
                 type);
+        psImageFree(out);
         return NULL;
     }
@@ -49,4 +51,5 @@
         psError(__func__,"Input image must be complex image for reverse FFT (type=%d).",
                 type);
+        psImageFree(out);
         return NULL;
 
@@ -95,4 +98,5 @@
 
     if (in == NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -154,4 +158,5 @@
 
     if (in == NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -215,4 +220,5 @@
 
     if (real == NULL || imag == NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -224,4 +230,5 @@
     if (imag->type.type != type) {
         psError(__func__,"The inputs to psImageComplex must be the same type.");
+        psImageFree(out);
         return NULL;
     }
@@ -230,4 +237,5 @@
             imag->numRows != numRows) {
         psError(__func__,"The inputs to psImageComplex must be the same dimensions.");
+        psImageFree(out);
         return NULL;
     }
@@ -235,4 +243,5 @@
     if (PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"The inputs to psImageComplex can not be complex.");
+        psImageFree(out);
         return NULL;
     }
@@ -240,4 +249,5 @@
     if (type != PS_TYPE_F32 && type != PS_TYPE_F64) {
         psError(__func__,"The input type to psImageComplex must be a floating point.");
+        psImageFree(out);
         return NULL;
     }
@@ -292,4 +302,5 @@
 
     if (in == NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -351,4 +362,5 @@
 
     if (in == NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -362,4 +374,5 @@
     if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"Power Spectrum for non-complex inputs is not implemented.");
+        psImageFree(out);
         return NULL;
     }
@@ -422,4 +435,5 @@
     /* got good image data? */
     if (in==NULL) {
+        psVectorFree(out);
         return NULL;
     }
@@ -430,4 +444,5 @@
         psError(__func__,"Input image must be a 32-bit float or complex image (type=%d)",
                 type);
+        psVectorFree(out);
         return NULL;
     }
@@ -436,4 +451,5 @@
         psError(__func__,"Input image must be complex image for reverse FFT (type=%d).",
                 type);
+        psVectorFree(out);
         return NULL;
 
@@ -494,4 +510,5 @@
 
     if (in == NULL) {
+        psVectorFree(out);
         return NULL;
     }
@@ -539,4 +556,5 @@
 
     if (in == NULL) {
+        psVectorFree(out);
         return NULL;
     }
@@ -636,4 +654,5 @@
 
     if (in == NULL) {
+        psVectorFree(out);
         return NULL;
     }
Index: /trunk/psLib/src/dataManip/psVectorFFT.c
===================================================================
--- /trunk/psLib/src/dataManip/psVectorFFT.c	(revision 1009)
+++ /trunk/psLib/src/dataManip/psVectorFFT.c	(revision 1010)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-12 01:33:16 $
+ *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-12 02:17:25 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -35,4 +35,5 @@
     /* got good image data? */
     if (in==NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -43,4 +44,5 @@
         psError(__func__,"Input image must be a 32-bit float or complex image (type=%d)",
                 type);
+        psImageFree(out);
         return NULL;
     }
@@ -49,4 +51,5 @@
         psError(__func__,"Input image must be complex image for reverse FFT (type=%d).",
                 type);
+        psImageFree(out);
         return NULL;
 
@@ -95,4 +98,5 @@
 
     if (in == NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -154,4 +158,5 @@
 
     if (in == NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -215,4 +220,5 @@
 
     if (real == NULL || imag == NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -224,4 +230,5 @@
     if (imag->type.type != type) {
         psError(__func__,"The inputs to psImageComplex must be the same type.");
+        psImageFree(out);
         return NULL;
     }
@@ -230,4 +237,5 @@
             imag->numRows != numRows) {
         psError(__func__,"The inputs to psImageComplex must be the same dimensions.");
+        psImageFree(out);
         return NULL;
     }
@@ -235,4 +243,5 @@
     if (PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"The inputs to psImageComplex can not be complex.");
+        psImageFree(out);
         return NULL;
     }
@@ -240,4 +249,5 @@
     if (type != PS_TYPE_F32 && type != PS_TYPE_F64) {
         psError(__func__,"The input type to psImageComplex must be a floating point.");
+        psImageFree(out);
         return NULL;
     }
@@ -292,4 +302,5 @@
 
     if (in == NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -351,4 +362,5 @@
 
     if (in == NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -362,4 +374,5 @@
     if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"Power Spectrum for non-complex inputs is not implemented.");
+        psImageFree(out);
         return NULL;
     }
@@ -422,4 +435,5 @@
     /* got good image data? */
     if (in==NULL) {
+        psVectorFree(out);
         return NULL;
     }
@@ -430,4 +444,5 @@
         psError(__func__,"Input image must be a 32-bit float or complex image (type=%d)",
                 type);
+        psVectorFree(out);
         return NULL;
     }
@@ -436,4 +451,5 @@
         psError(__func__,"Input image must be complex image for reverse FFT (type=%d).",
                 type);
+        psVectorFree(out);
         return NULL;
 
@@ -494,4 +510,5 @@
 
     if (in == NULL) {
+        psVectorFree(out);
         return NULL;
     }
@@ -539,4 +556,5 @@
 
     if (in == NULL) {
+        psVectorFree(out);
         return NULL;
     }
@@ -636,4 +654,5 @@
 
     if (in == NULL) {
+        psVectorFree(out);
         return NULL;
     }
Index: /trunk/psLib/src/fft/psVectorFFT.c
===================================================================
--- /trunk/psLib/src/fft/psVectorFFT.c	(revision 1009)
+++ /trunk/psLib/src/fft/psVectorFFT.c	(revision 1010)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-12 01:33:16 $
+ *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-12 02:17:25 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -35,4 +35,5 @@
     /* got good image data? */
     if (in==NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -43,4 +44,5 @@
         psError(__func__,"Input image must be a 32-bit float or complex image (type=%d)",
                 type);
+        psImageFree(out);
         return NULL;
     }
@@ -49,4 +51,5 @@
         psError(__func__,"Input image must be complex image for reverse FFT (type=%d).",
                 type);
+        psImageFree(out);
         return NULL;
 
@@ -95,4 +98,5 @@
 
     if (in == NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -154,4 +158,5 @@
 
     if (in == NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -215,4 +220,5 @@
 
     if (real == NULL || imag == NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -224,4 +230,5 @@
     if (imag->type.type != type) {
         psError(__func__,"The inputs to psImageComplex must be the same type.");
+        psImageFree(out);
         return NULL;
     }
@@ -230,4 +237,5 @@
             imag->numRows != numRows) {
         psError(__func__,"The inputs to psImageComplex must be the same dimensions.");
+        psImageFree(out);
         return NULL;
     }
@@ -235,4 +243,5 @@
     if (PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"The inputs to psImageComplex can not be complex.");
+        psImageFree(out);
         return NULL;
     }
@@ -240,4 +249,5 @@
     if (type != PS_TYPE_F32 && type != PS_TYPE_F64) {
         psError(__func__,"The input type to psImageComplex must be a floating point.");
+        psImageFree(out);
         return NULL;
     }
@@ -292,4 +302,5 @@
 
     if (in == NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -351,4 +362,5 @@
 
     if (in == NULL) {
+        psImageFree(out);
         return NULL;
     }
@@ -362,4 +374,5 @@
     if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"Power Spectrum for non-complex inputs is not implemented.");
+        psImageFree(out);
         return NULL;
     }
@@ -422,4 +435,5 @@
     /* got good image data? */
     if (in==NULL) {
+        psVectorFree(out);
         return NULL;
     }
@@ -430,4 +444,5 @@
         psError(__func__,"Input image must be a 32-bit float or complex image (type=%d)",
                 type);
+        psVectorFree(out);
         return NULL;
     }
@@ -436,4 +451,5 @@
         psError(__func__,"Input image must be complex image for reverse FFT (type=%d).",
                 type);
+        psVectorFree(out);
         return NULL;
 
@@ -494,4 +510,5 @@
 
     if (in == NULL) {
+        psVectorFree(out);
         return NULL;
     }
@@ -539,4 +556,5 @@
 
     if (in == NULL) {
+        psVectorFree(out);
         return NULL;
     }
@@ -636,4 +654,5 @@
 
     if (in == NULL) {
+        psVectorFree(out);
         return NULL;
     }
