Index: trunk/ippTools/src/difftoolConfig.c
===================================================================
--- trunk/ippTools/src/difftoolConfig.c	(revision 11818)
+++ trunk/ippTools/src/difftoolConfig.c	(revision 11853)
@@ -27,6 +27,6 @@
 #include "p5tool.h"
 
-// this function can not fail -- exits on error
-pxConfig *p5toolConfig(pxConfig *config, int argc, char **argv) {
+pxConfig *p5toolConfig(pxConfig *config, int argc, char **argv)
+{
     if (!config) {
         config = pxConfigAlloc();
@@ -39,5 +39,6 @@
     if (!config->modules) {
         psError(PS_ERR_UNKNOWN, false, "Can't find site configuration");
-        goto FAIL;
+        psFree(config);
+        return NULL;
     }
 
@@ -148,5 +149,6 @@
         if (config->mode) { \
             psError(PS_ERR_UNKNOWN, true, "only one mode selection is allowed"); \
-            goto FAIL; \
+            psFree(config); \
+            return NULL; \
         } \
         config->mode = modeval; \
@@ -196,5 +198,6 @@
 
         psFree(argSets);
-        goto FAIL;
+        psFree(config);
+        return NULL;
     }
 
@@ -209,5 +212,6 @@
         if (!psMetadataAddStr(config->where, PS_LIST_TAIL, #name, 0, "==", str)) {\
             psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \
-            goto FAIL; \
+            psFree(config); \
+            return NULL; \
         } \
     } \
@@ -221,5 +225,6 @@
         if (!psMetadataAddS32(config->where, PS_LIST_TAIL, #name, 0, "==", s32)) { \
             psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \
-            goto FAIL; \
+            psFree(config); \
+            return NULL; \
         } \
     } \
@@ -236,5 +241,6 @@
         if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "p5_id", 0, "==", (psS32)atoi(str))) {
             psError(PS_ERR_UNKNOWN, false, "failed to add item p5_id");
-            goto FAIL; 
+            psFree(config);
+            return NULL;
         } 
     } 
@@ -246,5 +252,6 @@
         if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "p4_id", 0, "==", (psS32)atoi(str))) {
             psError(PS_ERR_UNKNOWN, false, "failed to add item p4_id");
-            goto FAIL; 
+            psFree(config);
+            return NULL;
         } 
     } 
@@ -264,5 +271,6 @@
     if (!config->dbh) {
         psError(PS_ERR_UNKNOWN, false, "Can't configure database");
-        goto FAIL;
+        psFree(config);
+        return NULL;
     }
 
@@ -272,9 +280,3 @@
 
     return config;
-
-FAIL:
-    psFree(config);
-    pmConfigDone();
-    psLibFinalize();
-    exit(EXIT_FAILURE);
-}
+}
