[4/8] Fix leak.

Submitted by bansan85 on Dec. 13, 2017, 7:41 p.m.

Details

Message ID 20171213194139.19359-4-legarrec.vincent@gmail.com
State New
Series "Series without cover letter"
Headers show

Commit Message

bansan85 Dec. 13, 2017, 7:41 p.m.
---
 test/stress-test.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/test/stress-test.c b/test/stress-test.c
index bdd70a8..273a2a2 100644
--- a/test/stress-test.c
+++ b/test/stress-test.c
@@ -386,13 +386,18 @@  create_random_bits_image (alpha_preference_t alpha_preference)
     /* Finally create the image */
     image = pixman_image_create_bits (format, width, height, bits, stride);
     if (!image)
+    {
+	free (coefficients);
 	return NULL;
+    }
 
     pixman_image_set_indexed (image, indexed);
     pixman_image_set_destroy_function (image, destroy, indexed);
     pixman_image_set_accessors (image, read_func, write_func);
     pixman_image_set_filter (image, filter, coefficients, n_coefficients);
 
+    free (coefficients);
+
     return image;
 }