mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-01 23:30:35 +00:00
[OpenVINO]Fix memory leak in IsDebugEnabled() under Windows (#5948)
* w * w Co-authored-by: modav <modav@microsoft.com>
This commit is contained in:
parent
4afdced775
commit
e207589631
1 changed files with 3 additions and 1 deletions
|
|
@ -26,7 +26,9 @@ bool IsDebugEnabled() {
|
|||
#ifdef _WIN32
|
||||
size_t env_name_len = 0;
|
||||
char* env_name = nullptr;
|
||||
return (_dupenv_s(&env_name, &env_name_len, "ORT_OPENVINO_ENABLE_DEBUG") == 0 && env_name != nullptr);
|
||||
bool res = (_dupenv_s(&env_name, &env_name_len, "ORT_OPENVINO_ENABLE_DEBUG") == 0 && env_name != nullptr);
|
||||
free(env_name);
|
||||
return res;
|
||||
#else
|
||||
return (std::getenv("ORT_OPENVINO_ENABLE_DEBUG") != nullptr);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue