[libcxx] Blind attempt to fix harmless leak in nodiscard_extensions.pass.cpp test
authorRoman Lebedev <lebedev.ri@gmail.com>
Sat, 22 Sep 2018 19:09:57 +0000 (19:09 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Sat, 22 Sep 2018 19:09:57 +0000 (19:09 +0000)
libcxx-libcxxabi-x86_64-linux-ubuntu-asan complains about a leak here.

llvm-svn: 342814

libcxx/test/libcxx/diagnostics/nodiscard_extensions.pass.cpp

index 63195b5..56e88d1 100644 (file)
@@ -21,6 +21,7 @@
 
 int main() {
   {
-    std::get_temporary_buffer<int>(1);
+    const auto p = std::get_temporary_buffer<int>(1);
+    std::return_temporary_buffer(p.first);
   }
 }