diff options
author | Jason Molenda <jmolenda@apple.com> | 2013-05-04 00:39:52 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2013-05-04 00:39:52 +0000 |
commit | fe806906d46ffe2b9acae8feef33715a7d417240 (patch) | |
tree | 83fb33403e71fa51e4244c37ec5387abe60b0558 /lldb/source/Host/common/FileSpec.cpp | |
parent | d9104c035914f37777e5c7e0d91261e57103a8cf (diff) | |
download | bcm5719-llvm-fe806906d46ffe2b9acae8feef33715a7d417240.tar.gz bcm5719-llvm-fe806906d46ffe2b9acae8feef33715a7d417240.zip |
fix a couple of clang static analyzer warnings.
Most important was a new[] + delete mismatch in ScanFormatDescriptor()
and a couple of possible memory leaks in FileSpec::EnumerateDirectory().
llvm-svn: 181080
Diffstat (limited to 'lldb/source/Host/common/FileSpec.cpp')
-rw-r--r-- | lldb/source/Host/common/FileSpec.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp index 8405c0a9f2b..82f5b344b9a 100644 --- a/lldb/source/Host/common/FileSpec.cpp +++ b/lldb/source/Host/common/FileSpec.cpp @@ -985,9 +985,13 @@ FileSpec::EnumerateDirectory case eEnumerateDirectoryResultExit: // Exit from the current directory at the current level. // Exit from this directory level and tell parent to // keep enumerating. + if (buf) + free (buf); return eEnumerateDirectoryResultNext; case eEnumerateDirectoryResultQuit: // Stop directory enumerations at any level + if (buf) + free (buf); return eEnumerateDirectoryResultQuit; } } |