onnxruntime
fc3bc097 - Fix memleak due to improper deletion of onnx::TypeProto wrapper in provider-bridge API (#26448)

Commit
130 days ago
Fix memleak due to improper deletion of onnx::TypeProto wrapper in provider-bridge API (#26448) ### Description There is a memory leak whenever an EP uses the provider-bridge API to create a `std::unique_ptr<onnx::TypeProto>`. The `onnx::TypeProto` is not properly deleted due to a missing `operator delete()` override for the `TypeProto` wrapper class. This delete operator override is necessary because the onnx library may use custom allocators. Affected EPs: Run `git grep -rn "TypeProto::Create()" onnxruntime/core/providers/` - QNN EP: Happens when QNN EP creates an EPContext model. To reproduce, run the `onnxruntime_provider_tests` with `--gtest_filter=*ContextBinary*`. - https://github.com/microsoft/onnxruntime/blob/860d0853a6eefdf19e21b0e9982bde2ffbc8a65d/onnxruntime/core/providers/qnn/builder/onnx_ctx_model_helper.cc#L73. - OpenVINO EP: Happens during QDQ stripping: - https://github.com/microsoft/onnxruntime/blob/860d0853a6eefdf19e21b0e9982bde2ffbc8a65d/onnxruntime/core/providers/openvino/qdq_transformations/qdq_stripping.cc#L76 - https://github.com/microsoft/onnxruntime/blob/860d0853a6eefdf19e21b0e9982bde2ffbc8a65d/onnxruntime/core/providers/openvino/qdq_transformations/qdq_stripping.cc#L473 - https://github.com/microsoft/onnxruntime/blob/860d0853a6eefdf19e21b0e9982bde2ffbc8a65d/onnxruntime/core/providers/openvino/qdq_transformations/qdq_stripping.cc#L654 - NV EP: - https://github.com/microsoft/onnxruntime/blob/860d0853a6eefdf19e21b0e9982bde2ffbc8a65d/onnxruntime/core/providers/nv_tensorrt_rtx/nv_execution_provider_helper.cc#L213 - VitisAI EP: - https://github.com/microsoft/onnxruntime/blob/860d0853a6eefdf19e21b0e9982bde2ffbc8a65d/onnxruntime/core/providers/vitisai/imp/node_arg.cc#L94 ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. -->
Parents
Loading