[polygon,spline,traps] Avoid free(NULL)

This commit is contained in:
Behdad Esfahbod 2007-03-13 06:09:09 -04:00
parent b706bd9b38
commit deed0f4734
3 changed files with 3 additions and 3 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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;