com php-src: fix leaking registry key handle: win32/registry.c
| From: | Anatol Belski | Date: | Tue, 10 Mar 2015 08:10:24 +0000 |
| Subject: | com php-src: fix leaking registry key handle: win32/registry.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85429@lists.php.net to get a copy of this message | ||
Commit: ea2e1972245f57cd7c09e82c3e16d72d51df00dc
Author: Anatol Belski <ab@php.net> Mon, 9 Mar 2015 20:38:34 +0100
Parents: fca341699ed851ac40d49a03fcf5d460c6d3c5ed
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ea2e1972245f57cd7c09e82c3e16d72d51df00dc
Log:
fix leaking registry key handle
Changed paths:
M win32/registry.c
Diff:
diff --git a/win32/registry.c b/win32/registry.c
index f44e71a..0167817 100644
--- a/win32/registry..c
+++ b/win32/registry.c
@@ -272,6 +272,7 @@ char *GetIniPathFromRegistry()
DWORD buflen = MAXPATHLEN;
reg_location = emalloc(MAXPATHLEN+1);
if(RegQueryValueEx(hKey, PHPRC_REGISTRY_NAME, 0, NULL, reg_location, &buflen) !=
ERROR_SUCCESS) {
+ RegCloseKey(hKey);
efree(reg_location);
reg_location = NULL;
return reg_location;