From bf44238fed9b1a21fc1f53dd03b1dad5ef769cdb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Jul 2026 08:19:31 +0000 Subject: [PATCH 1/2] Initial plan From dbdb3d3a89960b0f79a2c21aee6b856bb73be3ac Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Jul 2026 08:21:26 +0000 Subject: [PATCH 2/2] Fix memory leak in GetOverridableInitializerNames() Add missing allocator.Free(name) after copying the name into the string vector, matching the pattern used in GetInputNames() and GetOutputNames(). Fixes #29603 --- include/onnxruntime/core/session/onnxruntime_cxx_inline.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/onnxruntime/core/session/onnxruntime_cxx_inline.h b/include/onnxruntime/core/session/onnxruntime_cxx_inline.h index ed3abc0961be6..a2c5a4a29dad0 100644 --- a/include/onnxruntime/core/session/onnxruntime_cxx_inline.h +++ b/include/onnxruntime/core/session/onnxruntime_cxx_inline.h @@ -1873,6 +1873,7 @@ inline std::vector ConstSessionImpl::GetOverridableInitializerNa char* name; ThrowOnError(GetApi().SessionGetOverridableInitializerName(this->p_, i, allocator, &name)); initializer_names.emplace_back(name); + allocator.Free(name); } return initializer_names;