[PATCH v2 3/3] msado15: Implement IConnectionPoint::Advise/Unadvise.

Hans Leidekker hans at codeweavers.com
Tue Jun 16 05:03:15 CDT 2020


On Tue, 2020-06-16 at 12:52 +0300, Aaro Altonen wrote:
> +        if (i == connpoint->sinks_size)
> +        {
> +            connpoint->sinks_size *= 2;
> +            connpoint->sinks = heap_realloc_zero( connpoint->sinks,
> +                    connpoint->sinks_size * sizeof(*connpoint->sinks) );
> +            if (!connpoint->sinks) return E_OUTOFMEMORY;
> +        }

If heap_realloc_zero fails this leaks the original allocation and
leaves the object in an inconsistent state. You can use temporary
variables to make this a transaction, like it's done in resize_fields.





More information about the wine-devel mailing list