[Piglit] [PATCH] arb_shader_atomic_counters-unique-id: Fix memory leak.

Vinson Lee vlee at freedesktop.org
Wed Aug 6 17:47:06 PDT 2014


Fixes Coverity "Resource leak" defect.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/spec/arb_shader_atomic_counters/unique-id.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/spec/arb_shader_atomic_counters/unique-id.c b/tests/spec/arb_shader_atomic_counters/unique-id.c
index 55b12e4..eee4f2c 100644
--- a/tests/spec/arb_shader_atomic_counters/unique-id.c
+++ b/tests/spec/arb_shader_atomic_counters/unique-id.c
@@ -63,6 +63,7 @@ check(int dx, int dy, uint32_t start_value, uint32_t end_value)
                                 printf("Probe value at (%d, %d)\n", x, y);
                                 printf("  Observed: 0x%08x\n", v);
                                 printf("  Value outside expected window.\n");
+                                free(frequency);
                                 return false;
                         }
 
@@ -70,6 +71,7 @@ check(int dx, int dy, uint32_t start_value, uint32_t end_value)
                                 printf("Probe value at (%d, %d)\n", x, y);
                                 printf("  Observed: 0x%08x\n", v);
                                 printf("  Value not unique.\n");
+                                free(frequency);
                                 return false;
                         }
                 }
-- 
1.9.3



More information about the Piglit mailing list