Index: trunk/ppSub/src/ppSub.c
===================================================================
--- trunk/ppSub/src/ppSub.c	(revision 23740)
+++ trunk/ppSub/src/ppSub.c	(revision 23753)
@@ -41,4 +41,5 @@
         psErrorStackPrint(stderr, "Error initialising model classes.\n");
         exitValue = PS_EXIT_PROG_ERROR;
+        psFree(config);
         goto die;
     }
@@ -47,10 +48,11 @@
         psErrorStackPrint(stderr, "Error initialising psphot.\n");
         exitValue = PS_EXIT_PROG_ERROR;
+        psFree(config);
         goto die;
     }
 
-    data = ppSubDataAlloc(); // Processing data
+    data = ppSubDataAlloc(config);
 
-    if (!ppSubArguments(argc, argv, config, data)) {
+    if (!ppSubArguments(argc, argv, data)) {
         psErrorStackPrint(stderr, "Error reading arguments.\n");
         exitValue = PS_EXIT_CONFIG_ERROR;
@@ -58,5 +60,5 @@
     }
 
-    if (!ppSubCamera(config, data)) {
+    if (!ppSubCamera(data)) {
         psErrorStackPrint(stderr, "Error setting up camera.\n");
         exitValue = PS_EXIT_CONFIG_ERROR;
@@ -64,5 +66,5 @@
     }
 
-    if (!ppSubLoop(config, data)) {
+    if (!ppSubLoop(data)) {
         psErrorStackPrint(stderr, "Error performing subtraction.\n");
         exitValue = PS_EXIT_SYS_ERROR;
@@ -75,5 +77,4 @@
 
     psFree(data);
-    psFree(config);
 
     pmVisualClose(); //close plot windows, if -visual is set
