[PATCH v2 05/11] shell32/autocomplete: Prevent txtbackup from being NULL to simplify the code

Huw Davies huw at codeweavers.com
Fri Sep 7 04:03:31 CDT 2018


On Thu, Sep 06, 2018 at 09:26:15PM +0300, Gabriel Ivăncescu wrote:
> Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
> ---
>  dlls/shell32/autocomplete.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c
> index b5a165c..2630517 100644
> --- a/dlls/shell32/autocomplete.c
> +++ b/dlls/shell32/autocomplete.c
> @@ -469,6 +469,10 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
>          return This->hwndEdit ? E_FAIL : E_UNEXPECTED;
>      }
>  
> +    /* Prevent txtbackup from ever being NULL to simplify the code */
> +    if ((This->txtbackup = heap_alloc_zero(sizeof(WCHAR))) == NULL)
> +        return E_OUTOFMEMORY;
> +

How exactly is this simplifiying the code?  It looks like it's just
adding code to me.

>      if (FAILED (IUnknown_QueryInterface (punkACL, &IID_IEnumString, (LPVOID*)&This->enumstr))) {
>          WARN("No IEnumString interface\n");
>          return E_NOINTERFACE;
> -- 
> 1.9.1
> 
> 
> 



More information about the wine-devel mailing list