mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-25 02:30:33 +01:00
[polygon,spline,traps] Avoid free(NULL)
This commit is contained in:
parent
b706bd9b38
commit
deed0f4734
3 changed files with 3 additions and 3 deletions
|
|
@ -56,7 +56,7 @@ _cairo_polygon_init (cairo_polygon_t *polygon)
|
|||
void
|
||||
_cairo_polygon_fini (cairo_polygon_t *polygon)
|
||||
{
|
||||
if (polygon->edges != polygon->edges_embedded)
|
||||
if (polygon->edges && polygon->edges != polygon->edges_embedded)
|
||||
free (polygon->edges);
|
||||
|
||||
polygon->edges = NULL;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ _cairo_spline_init (cairo_spline_t *spline,
|
|||
void
|
||||
_cairo_spline_fini (cairo_spline_t *spline)
|
||||
{
|
||||
if (spline->points != spline->points_embedded)
|
||||
if (spline->points && spline->points != spline->points_embedded)
|
||||
free (spline->points);
|
||||
|
||||
spline->points = NULL;
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ _cairo_traps_init (cairo_traps_t *traps)
|
|||
void
|
||||
_cairo_traps_fini (cairo_traps_t *traps)
|
||||
{
|
||||
if (traps->traps != traps->traps_embedded)
|
||||
if (traps->traps && traps->traps != traps->traps_embedded)
|
||||
free (traps->traps);
|
||||
|
||||
traps->traps = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue