On 07/13/2016 05:26 PM, Vinson Lee wrote:
Fix resource leak defect reported by Coverity.CID: 1363040 Fixes: 3529e325ff98 ("Rewrite copy-pixels test") Signed-off-by: Vinson Lee <[email protected]> --- tests/general/copy-pixels.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/general/copy-pixels.c b/tests/general/copy-pixels.c index 308868612fa8..cff1cb65adeb 100644 --- a/tests/general/copy-pixels.c +++ b/tests/general/copy-pixels.c @@ -47,10 +47,10 @@ test_color_copypix(int x, int y) bool pass = true; GLuint tex; - const float *expected = piglit_rgbw_image(GL_RGBA, - IMAGE_WIDTH, IMAGE_HEIGHT, - GL_FALSE, /* alpha */ - GL_UNSIGNED_NORMALIZED); + float *expected = piglit_rgbw_image(GL_RGBA, + IMAGE_WIDTH, IMAGE_HEIGHT, + GL_FALSE, /* alpha */ + GL_UNSIGNED_NORMALIZED); /* Initialize color data */ tex = piglit_rgbw_texture(GL_RGBA, IMAGE_WIDTH, IMAGE_HEIGHT, @@ -65,6 +65,7 @@ test_color_copypix(int x, int y) glCopyPixels(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT, GL_COLOR); pass = piglit_probe_image_color(x, y, IMAGE_WIDTH, IMAGE_HEIGHT, GL_RGBA, expected) && pass; + free(expected); return pass; }
Reviewed-by: Brian Paul <[email protected]> _______________________________________________ Piglit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/piglit
