about summary refs log tree commit diff
path: root/src/libstore/remote-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-01-16T21·24+0100
committerEelco Dolstra <edolstra@gmail.com>2017-01-16T21·24+0100
commit2b9d0a99cbf7649c20492bc539e2823a2d2e57c5 (patch)
treebdf06b8448c4f8b619383bda5284e7b4ee1219d6 /src/libstore/remote-store.cc
parent40dfac968a87c1d90b5b3c9e3ffe72a370165047 (diff)
AutoDeleteArray -> std::unique_ptr
Also, switch to C++14 for std::make_unique.
Diffstat (limited to 'src/libstore/remote-store.cc')
-rw-r--r--src/libstore/remote-store.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index 77faa2f801f1..816d95ba6075 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -599,9 +599,8 @@ void RemoteStore::Connection::processStderr(Sink * sink, Source * source)
         else if (msg == STDERR_READ) {
             if (!source) throw Error("no source");
             size_t len = readInt(from);
-            unsigned char * buf = new unsigned char[len];
-            AutoDeleteArray<unsigned char> d(buf);
-            writeString(buf, source->read(buf, len), to);
+            auto buf = std::make_unique<unsigned char[]>(len);
+            writeString(buf.get(), source->read(buf.get(), len), to);
             to.flush();
         }
         else