summaryrefslogtreecommitdiff
path: root/src/cairo-pen.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-06-04 14:12:20 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-06-04 14:17:43 +0100
commit132f44dce1884c9beed8c5e6588140ee8fa9cfbe (patch)
tree1cd955f3a06de9b3a2c9ebc1114dd74643054ebf /src/cairo-pen.c
parente89828c5331579d0d4019b6339df09ba1e2aa32e (diff)
valgrindify init/fini routines
Annotate object init/fini routines to detect use-after-free for on-stack/embedded objects.
Diffstat (limited to 'src/cairo-pen.c')
-rw-r--r--src/cairo-pen.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cairo-pen.c b/src/cairo-pen.c
index eb66b1a0..b2fd8557 100644
--- a/src/cairo-pen.c
+++ b/src/cairo-pen.c
@@ -58,6 +58,8 @@ _cairo_pen_init (cairo_pen_t *pen,
if (CAIRO_INJECT_FAULT ())
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+ VG (VALGRIND_MAKE_MEM_UNDEFINED (pen, sizeof (cairo_pen_t)));
+
pen->radius = radius;
pen->tolerance = tolerance;
@@ -103,13 +105,15 @@ _cairo_pen_fini (cairo_pen_t *pen)
if (pen->vertices != pen->vertices_embedded)
free (pen->vertices);
- pen->vertices = pen->vertices_embedded;
- pen->num_vertices = 0;
+
+ VG (VALGRIND_MAKE_MEM_NOACCESS (pen, sizeof (cairo_pen_t)));
}
cairo_status_t
_cairo_pen_init_copy (cairo_pen_t *pen, const cairo_pen_t *other)
{
+ VG (VALGRIND_MAKE_MEM_UNDEFINED (pen, sizeof (cairo_pen_t)));
+
*pen = *other;
if (CAIRO_INJECT_FAULT ())