[Bug 47088] New: All allocated dynamic memory should be explicitly deallocated to avoid memory leaks.(llvm-project/lldb/source/Host/windows/Windows.cpp:line 146)

Bug ID 47088
Summary All allocated dynamic memory should be explicitly deallocated to avoid memory leaks.(llvm-project/lldb/source/Host/windows/Windows.cpp:line 146)
Product lldb
Version unspecified
Hardware All
OS All
Status NEW
Severity normal
Priority P
Component All Bugs
Assignee lldb-dev@lists.llvm.org
Reporter info@ustchcs.com
CC jdevlieghere@apple.com, llvm-bugs@lists.llvm.org

All allocated dynamic memory should be explicitly deallocated to avoid memory
leaks.Before return on line 146, the memory allocated on line 130 is not freed.

commit e3546c78cabfbf670391a57766872f0a8e28a423

llvm-project/lldb/source/Host/windows/Windows.cpp:line 146

   141    wchar_t wideFullPathBuffer[PATH_MAX];
   142    wchar_t *wideFullPath;
   143    if ((wideFullPath = _wfullpath(wideFullPathBuffer, wideName,
PATH_MAX)) ==
   144        NULL) {
   145      errno = ENAMETOOLONG;
   146      return NULL;
   147    }

Reported by: Ustchcs Toolsets Bugfinder
(bugfinder-13.19: All allocated dynamic memory should be explicitly deallocated
to avoid memory leaks.)

Raphael Isemann changed bug 47088