From: Davin McCall Date: Sun, 12 Mar 2017 23:16:15 +0000 (+0000) Subject: Fix trivial memory leak. X-Git-Tag: v0.05~9 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=aff37f4bbc3a24b7c3f0cb4ac8652ac03ffce7b7;p=oweals%2Fdinit.git Fix trivial memory leak. --- 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);