diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2009-03-30 13:13:39 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2009-03-30 13:13:39 -0400 |
commit | 434011df553c8d40c1e6508c9bdea4884e591f97 (patch) | |
tree | 2fa925f1f9a03a674947126e39b9e20bc94d3db2 /examples/cairotwisted.c | |
parent | 17ea2edc6defca2862bd45680d80e525998ea738 (diff) | |
download | pango-434011df553c8d40c1e6508c9bdea4884e591f97.tar.gz |
[cairotwisted] Plug leak
Diffstat (limited to 'examples/cairotwisted.c')
-rw-r--r-- | examples/cairotwisted.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/cairotwisted.c b/examples/cairotwisted.c index 056377d2..27b9fb04 100644 --- a/examples/cairotwisted.c +++ b/examples/cairotwisted.c @@ -211,6 +211,8 @@ typedef double parametrization_t; /* Compute parametrization info. That is, for each part of the * cairo path, tags it with its length. + * + * Free returned value with g_free(). */ static parametrization_t * parametrize_path (cairo_path_t *path) @@ -219,7 +221,7 @@ parametrize_path (cairo_path_t *path) cairo_path_data_t *data, last_move_to, current_point; parametrization_t *parametrization; - parametrization = malloc (path->num_data * sizeof (parametrization[0])); + parametrization = g_malloc (path->num_data * sizeof (parametrization[0])); for (i=0; i < path->num_data; i += path->data[i].header.length) { data = &path->data[i]; @@ -454,6 +456,8 @@ map_path_onto (cairo_t *cr, cairo_path_t *path) (transform_point_func_t) point_on_path, ¶m); cairo_append_path (cr, current_path); + + g_free (param.parametrization); } |