diff options
author | Dylan Noblesmith <nobled@dreamwidth.org> | 2014-08-25 00:58:13 +0000 |
---|---|---|
committer | Dylan Noblesmith <nobled@dreamwidth.org> | 2014-08-25 00:58:13 +0000 |
commit | 0b59924d60b03f8d722e5ffa12aecf3329bb1095 (patch) | |
tree | 555e9c4223c738d3022817b6e39c884a18299538 /llvm/lib/Support/Path.cpp | |
parent | 49c758b769b9a787d415a9c2ce0e40fa0e482412 (diff) | |
download | bcm5719-llvm-0b59924d60b03f8d722e5ffa12aecf3329bb1095.tar.gz bcm5719-llvm-0b59924d60b03f8d722e5ffa12aecf3329bb1095.zip |
Support/Path: remove raw delete
llvm-svn: 216360
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r-- | llvm/lib/Support/Path.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp index 4d179218f78..f633967697c 100644 --- a/llvm/lib/Support/Path.cpp +++ b/llvm/lib/Support/Path.cpp @@ -881,7 +881,8 @@ std::error_code copy_file(const Twine &From, const Twine &To) { } const size_t BufSize = 4096; - char *Buf = new char[BufSize]; + std::vector<char> Buffer(BufSize); + char *Buf = Buffer.data(); int BytesRead = 0, BytesWritten = 0; for (;;) { BytesRead = read(ReadFD, Buf, BufSize); @@ -898,7 +899,6 @@ 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()); |