Fix cases where OOM was handled wrong
authorCharles Giessen <charles@lunarg.com>
Wed, 16 Nov 2022 04:16:55 +0000 (21:16 -0700)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Wed, 16 Nov 2022 16:48:11 +0000 (09:48 -0700)
commit27d86008d87581980c3c61730d8a44acc7e49ff1
treeb41a2b132c2875b78137f3bdf7d91146a2468325
parentb7d671c2ba6bd58507a786609a004ed11821067c
Fix cases where OOM was handled wrong

goto's were replaced by returns erroneously. This caused unfreed memory in
certain OOM scenarios, caught by CTS. The reason the loader tests didn't catch
this was because the fake drivers did not report any extensions, thus no memory
was allocated (which would later be leaked). This commit addressess this
deficiency in the tests as well, which included correctly incrementing the
MemoryTracker's allocation count during realloc.
loader/loader.c
tests/loader_alloc_callback_tests.cpp