[igt-dev] [PATCH i-g-t] tests/gem_ccs: Fix memory leak in destroy_object

Karolina Stolarek karolina.stolarek at intel.com
Wed Dec 14 10:51:42 UTC 2022


Free the copy object itself after gem_close

Signed-off-by: Karolina Stolarek <karolina.stolarek at intel.com>
---
 tests/i915/gem_ccs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/i915/gem_ccs.c b/tests/i915/gem_ccs.c
index 4ecb3e36..00f08eea 100644
--- a/tests/i915/gem_ccs.c
+++ b/tests/i915/gem_ccs.c
@@ -141,6 +141,7 @@ static void destroy_object(int i915, struct blt_copy_object *obj)
 		munmap(obj->ptr, obj->size);
 
 	gem_close(i915, obj->handle);
+	free(obj);
 }
 
 static void set_blt_object(struct blt_copy_object *obj,
-- 
2.25.1



More information about the igt-dev mailing list