[PATCH 2/7] regedit: Use a helper function to allocate memory and check for a valid pointer

Alexandre Julliard julliard at winehq.org
Wed Jul 26 11:41:57 CDT 2017


Hugh McMaster <hugh.mcmaster at outlook.com> writes:

> +static void *heap_alloc(size_t size)
> +{
> +    void *buf;
> +
> +    if (!(buf = HeapAlloc(GetProcessHeap(), 0, size)))
> +    {
> +        ERR("Out of memory!\n");
> +        exit(1);
> +    }
> +
> +    return buf;
> +}

That's not the standard heap_alloc(), so a different name would be
preferable. I'd suggest heap_xalloc by analogy with xmalloc.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list