loader: Fix double free when enabling override
authorLenny Komow <lenny@lunarg.com>
Thu, 8 Nov 2018 17:26:54 +0000 (10:26 -0700)
committerLenny Komow <lenny@lunarg.com>
Thu, 8 Nov 2018 18:12:40 +0000 (11:12 -0700)
Change-Id: I92f0012528bf1fb4cd9acf3053a4850665b225e8

loader/loader.c

index 6e5e181033b56303c81027af3035c9b80e151151..a20f918197b0fef289715e6b9ea768853d826219 100644 (file)
@@ -3801,6 +3801,7 @@ static VkResult loaderGetDataFiles(const struct loader_instance *inst, enum load
         for (uint32_t i = 0; i < out_files->count; i++) {
             if (NULL != out_files->filename_list[i]) {
                 loader_instance_heap_free(inst, out_files->filename_list[i]);
+                out_files->filename_list[i] = NULL;
             }
         }
         loader_instance_heap_free(inst, out_files->filename_list);
@@ -4296,6 +4297,7 @@ void loaderScanForImplicitLayers(struct loader_instance *inst, struct loader_lay
         res = loaderAddLayerProperties(inst, instance_layers, json, true, file_str);
 
         loader_instance_heap_free(inst, file_str);
+        manifest_files.filename_list[i] = NULL;
         cJSON_Delete(json);
 
         if (VK_ERROR_OUT_OF_HOST_MEMORY == res) {