[cairo-commit] cairo/test cairo-test.c,1.63,1.64

Carl Worth commit at pdx.freedesktop.org
Wed Dec 7 11:53:32 PST 2005


Committed by: cworth

Update of /cvs/cairo/cairo/test
In directory gabe:/tmp/cvs-serv11324/test

Modified Files:
	cairo-test.c 
Log Message:

2005-12-07  Carl Worth  <cworth at cworth.org>

        * test/cairo-test.c: (create_ps_surface): Fix to check
        cairo_surface_status rather than !surface which is always false.
        (cleanup_ps): Fix leak of filename memory.


Index: cairo-test.c
===================================================================
RCS file: /cvs/cairo/cairo/test/cairo-test.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- cairo-test.c	17 Nov 2005 19:55:21 -0000	1.63
+++ cairo-test.c	7 Dec 2005 19:53:30 -0000	1.64
@@ -543,7 +543,8 @@
     
     xasprintf (&ptc->filename, "%s-%s%s", test->name, "ps-rgb24-out", ".ps");
     surface = cairo_ps_surface_create (ptc->filename, width, height);
-    if (!surface) {
+    if (cairo_surface_status (surface)) {
+	free (ptc->filename);
 	free (ptc);
 	return NULL;
     }
@@ -570,6 +571,7 @@
 cleanup_ps (void *closure)
 {
     ps_target_closure_t *ptc = closure;
+    free (ptc->filename);
     free (ptc);
 }
 



More information about the cairo-commit mailing list