[PATCH v2 0/4] MR322: winex11.drv: Preparation for nulldrv display modes.

Zhiyi Zhang (@zhiyi) wine at gitlab.winehq.org
Thu Jun 30 02:16:20 CDT 2022


Zhiyi Zhang (@zhiyi) commented about dlls/winex11.drv/desktop.c:
> +                                         'D','e','s','k','t','o','p','s',0};
> +    static const WCHAR defaultW[] = {'D','e','f','a','u','l','t',0};
> +    WCHAR buffer[4096];
> +    KEY_VALUE_PARTIAL_INFORMATION *value = (void *)buffer;
> +    DWORD size;
> +    HKEY hkey;
> +
> +    *width = 800;
> +    *height = 600;
> +
> +    /* @@ Wine registry key: HKCU\Software\Wine\Explorer\Desktops */
> +    if (!(hkey = reg_open_hkcu_key( desktop_keyW, sizeof(desktop_keyW) )))
> +        return FALSE;
> +
> +    size = query_reg_value( hkey, defaultW, value, sizeof(buffer) );
> +    if (!size || value->Type != REG_SZ) return FALSE;
hkey is leaked here. You should close hkey right after query_reg_value().

-- 
https://gitlab.winehq.org/wine/wine/-/merge_requests/322#note_2996



More information about the wine-devel mailing list