From 1fc7f92f254f99092bc69e85b817469a281adad6 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Fri, 25 Dec 2020 13:02:21 -0800 Subject: [PATCH] Fix a memory leak in test_inference.cc (#6201) * Fix a memory leak in test_inference.cc --- onnxruntime/test/shared_lib/test_inference.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/onnxruntime/test/shared_lib/test_inference.cc b/onnxruntime/test/shared_lib/test_inference.cc index faa42c6f36..737f5b6a0e 100644 --- a/onnxruntime/test/shared_lib/test_inference.cc +++ b/onnxruntime/test/shared_lib/test_inference.cc @@ -331,6 +331,7 @@ struct SliceCustomOpKernel { const OrtValue* input_to = ort_.KernelContext_GetInput(context, 2); OrtTensorTypeAndShapeInfo* input_X_info = ort_.GetTensorTypeAndShape(input_X); ONNXTensorElementDataType input_X_type = ort_.GetTensorElementType(input_X_info); + ort_.ReleaseTensorTypeAndShapeInfo(input_X_info); #if USE_CUDA int64_t slice_from = 0; int64_t slice_to = 0;