d2d1: Fix double free bug when d2d_geometry_sink_Close fails.

geometry->fill.bezier_vertices was being freed on the failed path in
d2d_geometry_sink_Close and then again when the path geometry was
released (in d2d_geometry_cleanup).

By setting it to NULL after freeing it initially, all other calls
to free it are a no-op.
This commit is contained in:
Brendan McGrath 2024-01-11 15:48:52 +11:00 committed by Alexandre Julliard
parent 6d8489a0bb
commit 1e79217fb0

View file

@ -3247,6 +3247,7 @@ done:
if (FAILED(hr))
{
free(geometry->fill.bezier_vertices);
geometry->fill.bezier_vertices = NULL;
geometry->fill.bezier_vertex_count = 0;
d2d_path_geometry_free_figures(geometry);
geometry->u.path.state = D2D_GEOMETRY_STATE_ERROR;