loader: Fix potential memory leak
authorCharles Giessen <charles@lunarg.com>
Thu, 13 May 2021 00:20:37 +0000 (18:20 -0600)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Thu, 9 Sep 2021 18:15:49 +0000 (12:15 -0600)
Also remove a redundant setting of an int to 0

Change-Id: Ia099ad75e9da14aacf9874d75267716c12794305

loader/loader.c

index cd7c63ff20090e874e4a4d5b5874a292631e7080..da264488530328a706efc521dbf1155a37d552af 100644 (file)
@@ -6447,7 +6447,7 @@ terminator_EnumerateInstanceExtensionProperties(const VkEnumerateInstanceExtensi
     }
 
 out:
-
+    loader_destroy_generic_list(NULL, (struct loader_generic_list *)&icd_tramp_list);
     loader_destroy_generic_list(NULL, (struct loader_generic_list *)&local_ext_list);
     loader_delete_layer_list_and_properties(NULL, &instance_layers);
     return res;
@@ -6812,7 +6812,6 @@ out:
             }
             loader_instance_heap_free(inst, new_phys_dev_groups);
         }
-        total_count = 0;
     } else {
         // Free everything that didn't carry over to the new array of
         // physical device groups