Index: /trunk/psModules/src/config/pmConfigRecipes.c
===================================================================
--- /trunk/psModules/src/config/pmConfigRecipes.c	(revision 10469)
+++ /trunk/psModules/src/config/pmConfigRecipes.c	(revision 10470)
@@ -286,17 +286,14 @@
         }
 
-        psMetadata *recipe = NULL;
-        psMetadata *current = NULL;
-
-        # if (0)
-
-            psString comment = NULL;
+        #if (0)
+        psString comment = NULL;
         psStringAppend(&comment, "Recipe added at %s from %s", sourceName, (char*)fileItem->data.V);
         psTrace ("psModules.pmConfig", 3, comment);
         psMetadataAddS32(config->recipesSource, PS_LIST_TAIL, fileItem->name, PS_META_REPLACE, comment, sourceType);
         psFree(comment);
-        # endif
+        #endif
 
         // Read the recipe file.
+        psMetadata *recipe = NULL;
         if (!pmConfigFileRead(&recipe, fileItem->data.V, "recipe")) {
             psError(PS_ERR_IO, false, "Failed to read recipe");
@@ -307,8 +304,10 @@
 
         // if this named recipe exists, supplement it
-        current = psMemIncrRefCounter (psMetadataLookupMetadata (NULL, config->recipes, fileItem->name));
+        psMetadata *current = psMemIncrRefCounter(psMetadataLookupMetadata(NULL, config->recipes,
+                              fileItem->name));
         current = psMetadataCopy (current, recipe);
-        psMetadataAdd(config->recipes, PS_LIST_TAIL, fileItem->name, PS_DATA_METADATA | PS_META_REPLACE, fileItem->comment, current);
         psFree(recipe);  // Drop reference
+        psMetadataAdd(config->recipes, PS_LIST_TAIL, fileItem->name, PS_DATA_METADATA | PS_META_REPLACE,
+                      fileItem->comment, current);
         psFree(current);  // Drop reference
     }
@@ -340,7 +339,4 @@
     psMetadataItem *item = NULL;    // MD item containing the filename, from recipe iteration
     while ((item = psMetadataGetAndIncrement(recipesIter))) {
-        psMetadata *recipe = NULL;
-        psMetadata *current = NULL;
-
         // type mismatch is a serious error
         if (item->type != PS_DATA_METADATA) {
@@ -348,11 +344,13 @@
         }
         // increment the ref counter to protect the data
-        recipe = psMemIncrRefCounter (item->data.V);
+
+        psMetadata *recipe = item->data.V; // Recipe of interest
 
         // if this named recipe exists, supplement it
-        current = psMemIncrRefCounter (psMetadataLookupMetadata (NULL, config->recipes, item->name));
+        psMetadata *current = psMemIncrRefCounter(psMetadataLookupMetadata(NULL, config->recipes,
+                              item->name));
         current = psMetadataCopy (current, recipe);
-        psMetadataAdd(config->recipes, PS_LIST_TAIL, item->name, PS_DATA_METADATA | PS_META_REPLACE, "added from command-line recipe", current);
-        psFree(recipe);  // Drop reference
+        psMetadataAdd(config->recipes, PS_LIST_TAIL, item->name, PS_DATA_METADATA | PS_META_REPLACE,
+                      "added from command-line recipe", current);
         psFree(current);  // Drop reference
     }
@@ -375,40 +373,32 @@
     while ((item = psMetadataGetAndIncrement(recipesIter))) {
         assert(item->type == PS_DATA_STRING); // It should be this type: we put it in ourselves
-        const char *symbolRef = psStringCopy (item->data.V); // The name of the symbolic reference
-        const char *symbolName = psStringCopy (item->name);
-
-        psMetadata *current = NULL;
-        psMetadata *recipe = NULL;
+        const char *symbolRef = item->data.V; // The name of the symbolic reference
+        const char *symbolName = item->name;
 
         // search for linkName in config->recipes
-        recipe = psMetadataLookupMetadata(NULL, config->recipes, symbolRef); // The source
+        psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, symbolRef); // The source
         if (recipe) {
             // if this named recipe exists, supplement it
-            current = psMemIncrRefCounter (psMetadataLookupMetadata (NULL, config->recipes, symbolName));
-            current = psMetadataCopy (current, recipe);
-            psMetadataAdd(config->recipes, PS_LIST_TAIL, symbolName, PS_DATA_METADATA | PS_META_REPLACE, symbolRef, current);
+            psMetadata *current = psMemIncrRefCounter(psMetadataLookupMetadata(NULL, config->recipes,
+                                  symbolName));
+            current = psMetadataCopy(current, recipe);
+            psMetadataAdd(config->recipes, PS_LIST_TAIL, symbolName, PS_DATA_METADATA | PS_META_REPLACE,
+                          symbolRef, current);
             psFree(current);  // Drop reference
-            psFree (symbolName);
-            psFree (symbolRef);
             continue;
         }
 
         // search for linkName in config->recipes:NAME
-        current = psMetadataLookupMetadata(NULL, config->recipes, symbolName); // The source
+        psMetadata *current = psMetadataLookupMetadata(NULL, config->recipes, symbolName); // The source
         if (current) {
             recipe = psMetadataLookupMetadata(NULL, current, symbolRef); // The source
             if (recipe) {
                 // supplement the existing recipe
-                current = psMetadataCopy (current, recipe);
-                psMetadataAdd(config->recipes, PS_LIST_TAIL, symbolName, PS_DATA_METADATA | PS_META_REPLACE, symbolRef, current);
+                psMetadataCopy (current, recipe);
+                psMetadataAdd(config->recipes, PS_LIST_TAIL, symbolName, PS_DATA_METADATA | PS_META_REPLACE,
+                              symbolRef, current);
                 continue;
             }
-            psFree(recipe);  // Drop reference
-            psFree(current);  // Drop reference
-            psFree (symbolName);
-            psFree (symbolRef);
-        }
-        psFree (symbolName);
-        psFree (symbolRef);
+        }
         // symbol is not found: ERROR
     }
