regedit: Check return values, don't request unneeded value which always fails.

oldstable
Lei Zhang 2008-10-02 01:35:59 -07:00 committed by Alexandre Julliard
parent 4389066754
commit 86a4e99c04
1 changed files with 4 additions and 1 deletions

View File

@ -267,7 +267,10 @@ static BOOL match_item(HWND hwndTV, HTREEITEM hItem, LPCWSTR sstring, int mode,
if ((mode & SEARCH_CONTENT) && (type == REG_EXPAND_SZ || type == REG_SZ)) {
LPWSTR buffer;
buffer = HeapAlloc(GetProcessHeap(), 0, lenValue);
RegEnumValueW(hKey, i, valName, &lenName, NULL, &type, (LPBYTE)buffer, &lenValue);
if (!buffer)
break;
if (ERROR_SUCCESS != RegEnumValueW(hKey, i, NULL, NULL, NULL, &type, (LPBYTE)buffer, &lenValue))
break;
if (match_string(buffer, sstring, mode)) {
HeapFree(GetProcessHeap(), 0, buffer);
RegCloseKey(hKey);