From 4dff9f9a39f699cdc3d08f4250cd7322cb7743c4 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 --- llvm/tools/llvm-objdump/MachODump.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp index f44e432..61b0b0e 100644 --- a/llvm/tools/llvm-objdump/MachODump.cpp +++ b/llvm/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) -- 2.7.4