aboutsummaryrefslogtreecommitdiff
path: root/loader/loader.c
diff options
context:
space:
mode:
authorSlawomir Cygan <slawomir.cygan@intel.com>2018-01-16 17:17:07 +0100
committerLenny Komow <lenny@lunarg.com>2018-01-16 15:46:32 -0700
commitc784290e43bf89ef3c52f112d5e7e2d06f75ab69 (patch)
treeeb4c634564229a5a4af7d5bddb0bf0a9e539b7c0 /loader/loader.c
parent32813b4140b58bc057d7bbb9ce39d67130d854dc (diff)
downloadusermoji-c784290e43bf89ef3c52f112d5e7e2d06f75ab69.tar.xz
Loader: fix open registry handle leak
Each handle returned by RegOpenKey*() API functions should be closed using RegCloseKey(). This change fixes AppVerifier warning on leaklin HKEY objects.
Diffstat (limited to 'loader/loader.c')
-rw-r--r--loader/loader.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/loader/loader.c b/loader/loader.c
index d7051008..0629d908 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -708,6 +708,7 @@ VkResult loaderGetRegistryFiles(const struct loader_instance *inst, char *locati
if (NULL == *reg_data) {
loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"loaderGetRegistryFiles: Failed to allocate space for registry data for key %s", name);
+ RegCloseKey(key);
result = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
}
@@ -720,6 +721,7 @@ VkResult loaderGetRegistryFiles(const struct loader_instance *inst, char *locati
inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
"loaderGetRegistryFiles: Failed to reallocate space for registry value of size %d for key %s",
*reg_data_size * 2, name);
+ RegCloseKey(key);
result = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
}
@@ -738,6 +740,7 @@ VkResult loaderGetRegistryFiles(const struct loader_instance *inst, char *locati
}
name_size = 2048;
}
+ RegCloseKey(key);
}
// Advance the location - if the next location is in the secondary hive, then reset the locations and advance the hive