From aea393c85cb834b7f8b582ea55a1bbfb534d1548 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Mon, 16 Mar 2020 06:27:00 -0600 Subject: [PATCH] C.180 example bugfix (#1587) new[] needs delete[] --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 1d34c5f..30e423a 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -8502,7 +8502,7 @@ But heed the warning: [Avoid "naked" `union`s](#Ru-naked) ~Immutable_string() { if (size >= buffer_size) - delete string_ptr; + delete[] string_ptr; } const char* get_str() const