diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-01-02 13:42:53 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-01-02 15:44:51 +0000 |
commit | dd65be740c475daf75c602fc79ff25977674d9cf (patch) | |
tree | 94ea99c4901c737b85da18042a8862359133006b /test/pdf-mime-data.c | |
parent | 65f9760d661a0eb2edf9e53fb1b74666ce0ba3b9 (diff) | |
download | cairo-dd65be740c475daf75c602fc79ff25977674d9cf.tar.gz |
[test/pdf-mime-data] Free data on error paths.
Cleanup the allocated buffers on error.
Diffstat (limited to 'test/pdf-mime-data.c')
-rw-r--r-- | test/pdf-mime-data.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/pdf-mime-data.c b/test/pdf-mime-data.c index 233374ddb..00cde9dfb 100644 --- a/test/pdf-mime-data.c +++ b/test/pdf-mime-data.c @@ -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); |