]> granicus.if.org Git - php/commitdiff
fix leaking registry key handle
authorAnatol Belski <ab@php.net>
Mon, 9 Mar 2015 19:38:34 +0000 (20:38 +0100)
committerAnatol Belski <ab@php.net>
Tue, 10 Mar 2015 08:10:24 +0000 (09:10 +0100)
win32/registry.c

index f44e71a436499db3d2797e0a9eb43243ab69553a..016781776c942e5b560d6a5aa4320076b55649df 100644 (file)
@@ -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;