diff --git a/win32/registry.c b/win32/registry.c index f44e71a4364..016781776c9 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;