Index: trunk/psLib/src/sys/psString.c
===================================================================
--- trunk/psLib/src/sys/psString.c	(revision 7879)
+++ trunk/psLib/src/sys/psString.c	(revision 7901)
@@ -13,6 +13,6 @@
  *  @author David Robbins, MHPCC
  *
- *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-07-12 21:17:51 $
+ *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-07-14 02:26:25 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -30,4 +30,27 @@
 #include "psErrorText.h"
 
+static void stringFree(psString string)
+{
+    // There is non dynamic allocated item
+}
+
+psString psStringAlloc(long nChar)
+{
+    if (nChar < 1) {
+        return NULL;
+    }
+    psString string = psAlloc(nChar + 1);
+    psMemSetDeallocator(string, (psFreeFunc)stringFree);
+    return string;
+}
+
+bool psMemCheckString(psPtr ptr)
+{
+    if (!is_psType(ptr)) {
+        return false;
+    }
+    return ( psMemGetDeallocator(ptr) == (psFreeFunc)stringFree );
+}
+
 psString psStringCopy(const char *string)
 {
@@ -231,4 +254,8 @@
         return input;
     }
+    if (!psMemCheckString(input)) {
+        return input;
+    }
+
 
     // replace == NULL is valid: it just means that we strip out the key
