Index: /trunk/archive/pslib/src/Utils/memory.c
===================================================================
--- /trunk/archive/pslib/src/Utils/memory.c	(revision 328)
+++ /trunk/archive/pslib/src/Utils/memory.c	(revision 329)
@@ -76,8 +76,10 @@
 	fprintf(stderr, "\n");
     } else if (ptr->refCounter <= 0) {
-	psError(__func__, "Block %ld allocated at %s:%d freed more than once at %s:%d\n",
+	psError(__func__, PS_ERR_BADFREE, PS_NEW_ERROR,
+		"Block %ld allocated at %s:%d freed more than once at %s:%d\n",
 		ptr->id, ptr->file, ptr->lineno, file, lineno);
     } else if (ptr->refCounter > 1) {
-	psError(__func__, "Block %ld allocated at %s:%d freed while still referenced at %s:%d\n",
+	psError(__func__,  PS_ERR_BADFREE, PS_NEW_ERROR,
+		"Block %ld allocated at %s:%d freed while still referenced at %s:%d\n",
 		ptr->id, ptr->file, ptr->lineno, file, lineno);
     }
@@ -192,5 +194,6 @@
     if (m == NULL) {
 	if (!quiet) {
-	    psError(__func__, "psMemCheckCorruption: NULL memory block\n");
+	    psError(__func__,  PS_ERR_MEMORY_CORRUPTION, PS_NEW_ERROR,
+		    "psMemCheckCorruption: NULL memory block\n");
 	}
 	return(1);
@@ -199,5 +202,6 @@
     if (!ALIGNED(m)) {
 	if (!quiet) {
-	    psError(__func__, "psMemCheckCorruption: non-aligned memory block\n");
+	    psError(__func__,  PS_ERR_MEMORY_CORRUPTION, PS_NEW_ERROR,
+		    "psMemCheckCorruption: non-aligned memory block\n");
 	}
 	return(1);
@@ -206,5 +210,5 @@
     if (m->magic0 != P_PS_MEMMAGIC || m->magic != P_PS_MEMMAGIC) {
 	if (!quiet) {
-	    psError(__func__,
+	    psError(__func__, PS_ERR_MEMORY_CORRUPTION, PS_NEW_ERROR,
 		    "psMemCheckCorruption: memory block %ld is corrupted\n", m->id);
 	}
