Index: trunk/psLib/test/psTest.c
===================================================================
--- trunk/psLib/test/psTest.c	(revision 1406)
+++ trunk/psLib/test/psTest.c	(revision 1695)
@@ -148,4 +148,5 @@
             int currentId = psMemGetId();
             int retVal = fcn();
+            psErrorClear(); // clear the error stack before checking for leaks
             if ( retVal == 0 ) { // only bother checking memory if test executed to end.
                 if ( psMemCheckLeaks( currentId, NULL, stderr ) != 0 ) {
@@ -172,4 +173,5 @@
         int currentId = psMemGetId();
         childReturn = fcn();
+        psErrorClear(); // clear the error stack before checking for leaks
         if ( childReturn == 0 ) { // only bother checking memory if test executed to end.
             if ( psMemCheckLeaks( currentId, NULL, stderr ) != 0 ) {
