From 237d18a61a97e963c7757bc878f38aee31508de5 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Sat, 2 Oct 2021 04:45:40 +0000 Subject: [PATCH] Fix memory leaks in mlir/test/CAPI/ir.c --- mlir/test/CAPI/ir.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mlir/test/CAPI/ir.c b/mlir/test/CAPI/ir.c index 931f72f..320030f 100644 --- a/mlir/test/CAPI/ir.c +++ b/mlir/test/CAPI/ir.c @@ -1525,6 +1525,7 @@ int registerOnlyStd() { ctx, mlirStringRefCreateFromCString( "not_existing_dialect.not_existing_op"))); + mlirContextDestroy(ctx); return 0; } @@ -1666,6 +1667,9 @@ int testClone() { // CHECK: constant 0 : index // CHECK: constant 1 : index + mlirOperationDestroy(constZero); + mlirOperationDestroy(constOne); + mlirContextDestroy(ctx); return 0; } @@ -1737,6 +1741,7 @@ void testDiagnostics() { // CHECK: deleting user data (userData: 42) // CHECK-NOT: processing diagnostic // CHECK: more test diagnostics + mlirContextDestroy(ctx); } int testTypeID(MlirContext ctx) { -- 2.7.4