loader: Fix invalid cleanup on allocation error
authorLenny Komow <lenny@lunarg.com>
Tue, 18 Aug 2020 21:38:08 +0000 (15:38 -0600)
committerLenny Komow <lenny@lunarg.com>
Thu, 20 Aug 2020 19:54:04 +0000 (13:54 -0600)
Change-Id: I781ba00a65fa59a02423ea0d7c4168bda2c50193

loader/trampoline.c

index 44d97954bc2f660cecece3e7a7ce7e93d4a29da8..ea1ee87803970a89370a0580eb9130adafcc657a 100644 (file)
@@ -538,9 +538,7 @@ out:
 
     if (NULL != ptr_instance) {
         if (res != VK_SUCCESS) {
-            if (NULL != ptr_instance->next) {
-                loader.instances = ptr_instance->next;
-            }
+            loader.instances = ptr_instance->next;
             if (NULL != ptr_instance->disp) {
                 loader_instance_heap_free(ptr_instance, ptr_instance->disp);
             }