From aff37f4bbc3a24b7c3f0cb4ac8652ac03ffce7b7 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Sun, 12 Mar 2017 23:16:15 +0000 Subject: [PATCH] Fix trivial memory leak. --- src/shutdown.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/shutdown.cc b/src/shutdown.cc index 63474ed..b9ff24c 100644 --- a/src/shutdown.cc +++ b/src/shutdown.cc @@ -140,9 +140,8 @@ int main(int argc, char **argv) } // Build buffer; - //uint16_t sname_len = strlen(service_name); - int bufsize = 2; - char * buf = new char[bufsize]; + constexpr int bufsize = 2; + char buf[bufsize]; buf[0] = DINIT_CP_SHUTDOWN; buf[1] = static_cast(shutdown_type); -- 2.25.1