diff options
Diffstat (limited to 'generic/Curve.c')
-rw-r--r-- | generic/Curve.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/Curve.c b/generic/Curve.c index 202e0ce..901f331 100644 --- a/generic/Curve.c +++ b/generic/Curve.c @@ -1842,11 +1842,15 @@ Coords(ZnItem item, if (c->points) { ZnFree(c->points); } - c->points = (ZnPoint *) ZnMalloc(*num_pts*sizeof(ZnPoint)); + c->points = ZnMalloc(*num_pts*sizeof(ZnPoint)); c->num_points = *num_pts; memcpy(c->points, *pts, *num_pts*sizeof(ZnPoint)); + if (c->controls) { + ZnFree(c->controls); + c->controls = NULL; + } if (*controls) { - c->controls = ZnRealloc(c->controls, *num_pts*sizeof(char)); + c->controls = ZnMalloc(*num_pts*sizeof(char)); memcpy(c->controls, *controls, *num_pts*sizeof(char)); } } |