Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test: Fix use after frees
  • Loading branch information
Bryce Harrington committed Dec 9, 2015
1 parent ad99e1b commit 0986ae4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/pdf-mime-data.c
Expand Up @@ -140,9 +140,9 @@ preamble (cairo_test_context_t *ctx)
cairo_surface_destroy (image);

if (status) {
free (filename);
cairo_test_log (ctx, "Failed to create pdf surface for file %s: %s\n",
filename, cairo_status_to_string (status));
free (filename);
return CAIRO_TEST_FAILURE;
}

Expand Down
3 changes: 2 additions & 1 deletion test/png.c
Expand Up @@ -136,15 +136,16 @@ preamble (cairo_test_context_t *ctx)
}
surface1 = cairo_image_surface_create_from_png (filename);
status = cairo_surface_status (surface1);
free (filename);
if (status) {
cairo_test_log (ctx, "Error reading '%s': %s\n",
filename, cairo_status_to_string (status));
free (filename);

cairo_surface_destroy (surface1);
cairo_surface_destroy (surface0);
return cairo_test_status_from_status (ctx, status);
}
free (filename);

if (! image_surface_equals (surface0, surface1)) {
cairo_test_log (ctx, "Error surface mismatch.\n");
Expand Down

0 comments on commit 0986ae4

Please sign in to comment.