diff --git a/mlir/lib/CAPI/IR/IR.cpp b/mlir/lib/CAPI/IR/IR.cpp --- a/mlir/lib/CAPI/IR/IR.cpp +++ b/mlir/lib/CAPI/IR/IR.cpp @@ -176,6 +176,12 @@ for (unsigned i = 0; i < state->nRegions; ++i) cppState.addRegion(std::unique_ptr(unwrap(state->regions[i]))); + free(state->results); + free(state->operands); + free(state->regions); + free(state->successors); + free(state->attributes); + return wrap(Operation::create(cppState)); }