mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 07:38:22 +02:00
[test/pdf-mime-data] Free data on error paths.
Cleanup the allocated buffers on error.
This commit is contained in:
parent
65f9760d66
commit
dd65be740c
1 changed files with 4 additions and 0 deletions
|
|
@ -149,6 +149,7 @@ preamble (cairo_test_context_t *ctx)
|
|||
|
||||
test_status = read_file (ctx, "pdf-mime-data.out-000.jpg", &out_data, &out_len);
|
||||
if (test_status) {
|
||||
free (data);
|
||||
cairo_test_log (ctx,
|
||||
"Could not read input jpeg file %s\n",
|
||||
"pdf-mime-data.out-000.jpg");
|
||||
|
|
@ -156,9 +157,12 @@ preamble (cairo_test_context_t *ctx)
|
|||
}
|
||||
|
||||
if (len != out_len || memcmp(data, out_data, len) != 0) {
|
||||
free (data);
|
||||
free (out_data);
|
||||
cairo_test_log (ctx, "output mime data does not match source mime data\n");
|
||||
return CAIRO_TEST_FAILURE;
|
||||
}
|
||||
|
||||
free (data);
|
||||
free (out_data);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue