aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Path.cpp
diff options
context:
space:
mode:
authorDylan Noblesmith <nobled@dreamwidth.org>2014-08-26 02:03:30 +0000
committerDylan Noblesmith <nobled@dreamwidth.org>2014-08-26 02:03:30 +0000
commit42836d95e0766d6bce81c7124173fe9137bb0da7 (patch)
tree451d701f6bc69bf75cb5d82fd7213dde32c92f90 /llvm/lib/Support/Path.cpp
parent4b535d1930577a269f4a6ac14e536b152011c2b7 (diff)
downloadllvm-42836d95e0766d6bce81c7124173fe9137bb0da7.zip
llvm-42836d95e0766d6bce81c7124173fe9137bb0da7.tar.gz
llvm-42836d95e0766d6bce81c7124173fe9137bb0da7.tar.bz2
Revert "Support/Path: remove raw delete"
This reverts commit r216360. llvm-svn: 216428
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r--llvm/lib/Support/Path.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
index f633967..4d17921 100644
--- a/llvm/lib/Support/Path.cpp
+++ b/llvm/lib/Support/Path.cpp
@@ -881,8 +881,7 @@ std::error_code copy_file(const Twine &From, const Twine &To) {
}
const size_t BufSize = 4096;
- std::vector<char> Buffer(BufSize);
- char *Buf = Buffer.data();
+ char *Buf = new char[BufSize];
int BytesRead = 0, BytesWritten = 0;
for (;;) {
BytesRead = read(ReadFD, Buf, BufSize);
@@ -899,6 +898,7 @@ std::error_code copy_file(const Twine &From, const Twine &To) {
}
close(ReadFD);
close(WriteFD);
+ delete[] Buf;
if (BytesRead < 0 || BytesWritten < 0)
return std::error_code(errno, std::generic_category());