On data mismatch free the recently mallocked buffer.

Signed-off-by: Mike Holmes <[email protected]>
---
 test/api_test/odp_ring_test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/test/api_test/odp_ring_test.c b/test/api_test/odp_ring_test.c
index 1da5845..eb1f301 100644
--- a/test/api_test/odp_ring_test.c
+++ b/test/api_test/odp_ring_test.c
@@ -286,6 +286,7 @@ static int consumer_fn(void)
                if (i == 0) {
                        for (i = 0; i < MAX_BULK; i++) {
                                if (src[i] != (void *)(unsigned long)i) {
+                                       free(src);
                                        printf("data mismatch.. lockless ops 
fail\n");
                                        return -1;
                                }
-- 
2.1.0


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to