summaryrefslogtreecommitdiff
path: root/tests/cl
diff options
context:
space:
mode:
authorVinson Lee <vlee@freedesktop.org>2014-12-16 22:19:26 -0800
committerVinson Lee <vlee@freedesktop.org>2014-12-17 10:23:13 -0800
commit5a11ead22417c44de8a72fb670a536ba1cc75b68 (patch)
treef7dea806c1c878b8197cd8f98cadf32e1960e1cc /tests/cl
parentbecfcca7bd9fc80824e0b91a891c7240b157575c (diff)
cl-api-create-image: Fix memory leak.
Fix Coverity "resource leak" defect. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Diffstat (limited to 'tests/cl')
-rw-r--r--tests/cl/api/create-image.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/cl/api/create-image.c b/tests/cl/api/create-image.c
index 46a98dd08..a1e143b29 100644
--- a/tests/cl/api/create-image.c
+++ b/tests/cl/api/create-image.c
@@ -44,8 +44,11 @@ static bool context_has_image_support(const piglit_cl_context ctx)
piglit_cl_get_device_info(ctx->device_ids[i],
CL_DEVICE_IMAGE_SUPPORT);
if (*image_support) {
+ free(image_support);
return true;
}
+
+ free(image_support);
}
return false;
}