From: Jim Meyering Date: Thu, 26 Dec 2013 18:44:10 +0000 (-0800) Subject: folly: avoid ASAN-detected new[] vs "delete" mismatch X-Git-Tag: v0.22.0~746 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=b4d29567be019d95235f4f35be47d5c6f9cf40d9;p=folly.git folly: avoid ASAN-detected new[] vs "delete" mismatch Summary: * folly/test/PackedSyncPtrTest.cpp: Avoid an operator new [] vs operator delete mismatch. Test Plan: fbconfig --platform-all=gcc-4.8.1-glibc-2.17 --sanitize=address \ folly/test:packed_sync_ptr_test && fbmake runtests Reviewed By: tudorb@fb.com FB internal diff: D1111227 --- diff --git a/folly/test/PackedSyncPtrTest.cpp b/folly/test/PackedSyncPtrTest.cpp index bb1ebc85..5c75354d 100644 --- a/folly/test/PackedSyncPtrTest.cpp +++ b/folly/test/PackedSyncPtrTest.cpp @@ -53,7 +53,7 @@ TEST(PackedSyncPtr, Basic) { sp.setExtra(0x13); EXPECT_EQ(sp.extra(), 0x13); EXPECT_EQ((sp.get() + 1)->second, 7); - delete sp.get(); + delete[] sp.get(); auto newP = new std::pair(); sp.set(newP); EXPECT_EQ(sp.extra(), 0x13);