Index: trunk/psLib/src/mathtypes/psVector.c
===================================================================
--- trunk/psLib/src/mathtypes/psVector.c	(revision 15384)
+++ trunk/psLib/src/mathtypes/psVector.c	(revision 15406)
@@ -10,6 +10,6 @@
 *  @author Joshua Hoblitt, University of Hawaii
 *
-*  @version $Revision: 1.98 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2007-09-28 20:59:48 $
+*  @version $Revision: 1.99 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2007-10-29 20:35:31 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -426,5 +426,8 @@
 
     if (!psVectorSortInPlace(outVector)) {
-        psFree(outVector);
+        if (outVector != inVector) {
+            // It was allocated here.
+            psFree(outVector);
+        }
         return NULL;
     }
