loader: Move disable_environment into function body

The function `loaderReadLayerJson` does not modify the
disable_environment parameter that is passed in. It can safely be made
a variable local to the function.

Change-Id: I25ef3f3e5f008082dc9514be8f607d2acbf212a1
diff --git a/loader/loader.c b/loader/loader.c
index 4e0c33a..c987c50 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -2922,8 +2922,7 @@
 }
 
 static VkResult loaderReadLayerJson(const struct loader_instance *inst, struct loader_layer_list *layer_instance_list,
-                                    cJSON *layer_node, layer_json_version version, cJSON *item, cJSON *disable_environment,
-                                    bool is_implicit, char *filename) {
+                                    cJSON *layer_node, layer_json_version version, cJSON *item, bool is_implicit, char *filename) {
     char *temp;
     char *name, *type, *library_path_str, *api_version;
     char *implementation_version, *description;
@@ -2932,6 +2931,7 @@
     cJSON *component_layers;
     cJSON *override_paths;
     cJSON *blacklisted_layers;
+    cJSON *disable_environment;
     VkExtensionProperties ext_prop;
     VkResult result = VK_ERROR_INITIALIZATION_FAILED;
     struct loader_layer_properties *props = NULL;
@@ -3608,7 +3608,6 @@
     cJSON *item, *layers_node, *layer_node;
     layer_json_version json_version = {0, 0, 0};
     char *vers_tok;
-    cJSON *disable_environment = NULL;
     // Make sure sure the top level json value is an object
     if (!json || json->type != 6) {
         goto out;
@@ -3662,8 +3661,7 @@
                            curLayer, filename);
                 goto out;
             }
-            result = loaderReadLayerJson(inst, layer_instance_list, layer_node, json_version, item, disable_environment,
-                                         is_implicit, filename);
+            result = loaderReadLayerJson(inst, layer_instance_list, layer_node, json_version, item, is_implicit, filename);
         }
     } else {
         // Otherwise, try to read in individual layers
@@ -3693,8 +3691,7 @@
                        filename);
         } else {
             do {
-                result = loaderReadLayerJson(inst, layer_instance_list, layer_node, json_version, item, disable_environment,
-                                             is_implicit, filename);
+                result = loaderReadLayerJson(inst, layer_instance_list, layer_node, json_version, item, is_implicit, filename);
                 layer_node = layer_node->next;
             } while (layer_node != NULL);
         }