projects
/
platform
/
upstream
/
Vulkan-LoaderAndValidationLayers.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cd3109e
)
Fix NULL-pointer dereference if can't find registry entry.
author
Ian Elliott
<ian@LunarG.com>
Fri, 3 Apr 2015 19:13:01 +0000
(13:13 -0600)
committer
Ian Elliott
<ian@LunarG.com>
Fri, 3 Apr 2015 19:13:01 +0000
(13:13 -0600)
loader/loader.c
patch
|
blob
|
history
diff --git
a/loader/loader.c
b/loader/loader.c
index
47cfb36
..
1de7c84
100644
(file)
--- a/
loader/loader.c
+++ b/
loader/loader.c
@@
-179,7
+179,7
@@
static char *loader_get_registry_and_env(const char *env_var,
registry_str = loader_get_registry_string(HKEY_LOCAL_MACHINE,
"Software\\XGL",
registry_value);
- registry_len =
strlen(registry_str)
;
+ registry_len =
(registry_str) ? strlen(registry_str) : 0
;
rtn_len = env_len + registry_len + 1;
if (rtn_len <= 2) {
@@
-205,7
+205,9
@@
static char *loader_get_registry_and_env(const char *env_var,
_snprintf(rtn_str, rtn_len, "%s", registry_str);
}
- free(registry_str);
+ if (registry_str) {
+ free(registry_str);
+ }
return(rtn_str);
}