Open llvmbot opened 6 years ago
The attached example reports a potential memory leak:
$ scan-build-6.0 clang++-6.0 -std=c++14 example.cpp
example.cpp:19:1: warning: Potential leak of memory pointed to by 'p' } ^
I believe there is no memory leak in this example though.
The example exhibits a pattern sometimes used in smart pointer implementations, such as Poco::AutoPtr: https://pocoproject.org/docs/Poco.AutoPtr.html
I believe the same issue in the static analyzer causes memory leak and null-pointer dereference warnings when using Poco::AutoPtr.
assigned to @devincoughlin
Extended Description
The attached example reports a potential memory leak:
$ scan-build-6.0 clang++-6.0 -std=c++14 example.cpp
example.cpp:19:1: warning: Potential leak of memory pointed to by 'p' } ^
I believe there is no memory leak in this example though.
The example exhibits a pattern sometimes used in smart pointer implementations, such as Poco::AutoPtr: https://pocoproject.org/docs/Poco.AutoPtr.html
I believe the same issue in the static analyzer causes memory leak and null-pointer dereference warnings when using Poco::AutoPtr.