fix leaking registry key handle

This commit is contained in:
Anatol Belski 2015-03-09 20:38:34 +01:00
parent fca341699e
commit ea2e197224

View file

@ -272,6 +272,7 @@ char *GetIniPathFromRegistry()
DWORD buflen = MAXPATHLEN; DWORD buflen = MAXPATHLEN;
reg_location = emalloc(MAXPATHLEN+1); reg_location = emalloc(MAXPATHLEN+1);
if(RegQueryValueEx(hKey, PHPRC_REGISTRY_NAME, 0, NULL, reg_location, &buflen) != ERROR_SUCCESS) { if(RegQueryValueEx(hKey, PHPRC_REGISTRY_NAME, 0, NULL, reg_location, &buflen) != ERROR_SUCCESS) {
RegCloseKey(hKey);
efree(reg_location); efree(reg_location);
reg_location = NULL; reg_location = NULL;
return reg_location; return reg_location;