projects
/
oweals
/
dinit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a8f03b1
)
Fix trivial memory leak.
author
Davin McCall
<davmac@davmac.org>
Sun, 12 Mar 2017 23:16:15 +0000
(23:16 +0000)
committer
Davin McCall
<davmac@davmac.org>
Sun, 12 Mar 2017 23:16:15 +0000
(23:16 +0000)
src/shutdown.cc
patch
|
blob
|
history
diff --git
a/src/shutdown.cc
b/src/shutdown.cc
index 63474edf197a5fb302383949f7d6938555eee37f..b9ff24cb03aea5b61f9118d2c11dcea2b7734d2f 100644
(file)
--- 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<char>(shutdown_type);