From 18df8e9c56e34bfb46b8794dde7e95a4f11bdd6b Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Wed, 14 Feb 2018 05:14:31 +0000 Subject: [PATCH] Use delete[] to deallocate array of chars llvm-svn: 325099 --- tools/llvm-objdump/MachODump.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp index f44e4324c5c..61b0b0e5d13 100644 --- a/tools/llvm-objdump/MachODump.cpp +++ b/tools/llvm-objdump/MachODump.cpp @@ -2760,7 +2760,7 @@ static void method_reference(struct DisassembleInfo *info, if (strcmp(*ReferenceName, "_objc_msgSend") == 0) { if (info->selector_name != nullptr) { if (info->method != nullptr) - delete info->method; + delete[] info->method; if (info->class_name != nullptr) { info->method = new char[5 + strlen(info->class_name) + strlen(info->selector_name)]; @@ -2793,7 +2793,7 @@ static void method_reference(struct DisassembleInfo *info, } else if (strcmp(*ReferenceName, "_objc_msgSendSuper2") == 0) { if (info->selector_name != nullptr) { if (info->method != nullptr) - delete info->method; + delete[] info->method; info->method = new char[17 + strlen(info->selector_name)]; if (info->method != nullptr) { if (Arch == Triple::x86_64)