[llvm] e03817f - [LLVM][Support] Fix leak in ErrorTest.cpp (#191326)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 9 17:22:57 PDT 2026


Author: Vitaly Buka
Date: 2026-04-10T00:22:53Z
New Revision: e03817ff4e16ab06fe0b38eec9b7ff31fc09f446

URL: https://github.com/llvm/llvm-project/commit/e03817ff4e16ab06fe0b38eec9b7ff31fc09f446
DIFF: https://github.com/llvm/llvm-project/commit/e03817ff4e16ab06fe0b38eec9b7ff31fc09f446.diff

LOG: [LLVM][Support] Fix leak in ErrorTest.cpp (#191326)

The leak is from #188718

Added: 
    

Modified: 
    llvm/unittests/Support/ErrorTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Support/ErrorTest.cpp b/llvm/unittests/Support/ErrorTest.cpp
index b242ac7823977..0006140a5b44b 100644
--- a/llvm/unittests/Support/ErrorTest.cpp
+++ b/llvm/unittests/Support/ErrorTest.cpp
@@ -1245,8 +1245,7 @@ TEST(Error, NonNullFails) {
                "Expected a non-null pointer but got a null pointer")
       << "checkNotNull(NullPtr) did not cause an abort for null pointer";
 
-  auto UniquePtr = std::make_unique<int>(0);
-  UniquePtr.release();
+  std::unique_ptr<int> UniquePtr;
   EXPECT_DEATH(auto TmpUniquePtr = checkNotNull(std::move(UniquePtr)),
                "Expected a non-null pointer but got a null pointer")
       << "checkNotNull(NullPtr) did not cause an abort for null pointer";


        


More information about the llvm-commits mailing list