Fixes Coverity "resource leak" defects.

Signed-off-by: Vinson Lee <v...@freedesktop.org>
---
 tests/cl/api/enqueue-fill-image.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/cl/api/enqueue-fill-image.c 
b/tests/cl/api/enqueue-fill-image.c
index ebcfba4..994ccb4 100644
--- a/tests/cl/api/enqueue-fill-image.c
+++ b/tests/cl/api/enqueue-fill-image.c
@@ -129,12 +129,14 @@ piglit_cl_test(const int argc,
        if(!piglit_cl_check_error(err, CL_SUCCESS)) {
                fprintf(stderr, "Failed (error code: %s): Creating an image\n",
                        piglit_cl_get_error_name(err));
+               free(image_support);
                return PIGLIT_FAIL;
        }
 
        if (!test(queue, image, pattern, origin, region,
                  0, NULL, NULL,
                  CL_SUCCESS, &result, "Enqueuing the image to be filled")) {
+               free(image_support);
                return PIGLIT_FAIL;
        }
 
@@ -145,6 +147,7 @@ piglit_cl_test(const int argc,
        if(!piglit_cl_check_error(err, CL_SUCCESS)) {
                fprintf(stderr, "Failed (error code: %s): Reading image\n",
                        piglit_cl_get_error_name(err));
+               free(image_support);
                return PIGLIT_FAIL;
        }
 
@@ -169,6 +172,7 @@ piglit_cl_test(const int argc,
                if (!piglit_cl_probe_integer(dst_buf[i], exp_buf[i], 0)) {
                        fprintf(stderr, "Error at %d: got %d, expected %d\n",
                                i, dst_buf[i], exp_buf[i]);
+                       free(image_support);
                        return PIGLIT_FAIL;
                }
        }
-- 
2.6.3

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to