Jacek Caban : comdlg32: Improve error handling in get_config_key_string.
Module: wine Branch: master Commit: a16b9ff58334e47a170170a339f2bbb3ae942a80 URL: https://source.winehq.org/git/wine.git/?a=commit;h=a16b9ff58334e47a170170a33... Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri May 8 16:41:12 2020 +0200 comdlg32: Improve error handling in get_config_key_string. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comdlg32/filedlg.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index 6b79fcfc83..538358bd5f 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -250,11 +250,10 @@ static BOOL get_config_key_string(HKEY hkey, const WCHAR *name, WCHAR **value) DWORD type, size; WCHAR *str; - if (hkey && !RegQueryValueExW(hkey, name, 0, &type, NULL, &size)) - { - if (type != REG_SZ && type != REG_EXPAND_SZ) - return FALSE; - } + if (RegQueryValueExW(hkey, name, 0, &type, NULL, &size)) + return FALSE; + if (type != REG_SZ && type != REG_EXPAND_SZ) + return FALSE; str = heap_alloc(size); if (RegQueryValueExW(hkey, name, 0, &type, (BYTE *)str, &size))
participants (1)
-
Alexandre Julliard