diff options
author | Bryce Harrington <bryce@osg.samsung.com> | 2015-07-30 16:45:15 -0700 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2015-07-30 16:45:15 -0700 |
commit | c04bd4308382db00347016e666f38fcfe8ee1f08 (patch) | |
tree | e20dea8c4a8cc4863bd44fd495979faf515ecc28 /test/pdf-mime-data.c | |
parent | 0dd5d84baef70dad68ab67ba172edeaa1b98a995 (diff) | |
download | cairo-c04bd4308382db00347016e666f38fcfe8ee1f08.tar.gz |
test: Free the memory, not the pointer to the memory
In read_file(), we see:
*data = malloc (*len);
...
if (fread(*data, *len, 1, fp) != 1) {
free(data);
...
The free call needs to be free(*data), to match the malloc call.
Matthias Clasen found this via Coverity and proposed the fix.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=91381
Diffstat (limited to 'test/pdf-mime-data.c')
-rw-r--r-- | test/pdf-mime-data.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/pdf-mime-data.c b/test/pdf-mime-data.c index fd5af1f7f..b49a1d18d 100644 --- a/test/pdf-mime-data.c +++ b/test/pdf-mime-data.c @@ -82,7 +82,7 @@ read_file (const cairo_test_context_t *ctx, } if (fread(*data, *len, 1, fp) != 1) { - free (data); + free (*data); fclose(fp); cairo_test_log (ctx, "Could not read data from file %s\n", file); return CAIRO_TEST_FAILURE; |