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:
b103ccb
)
Use delete[] to delete buffers allocated via new[]
author
Davin McCall
<davmac@davmac.org>
Thu, 14 Jan 2016 10:02:40 +0000
(10:02 +0000)
committer
Davin McCall
<davmac@davmac.org>
Thu, 14 Jan 2016 10:02:40 +0000
(10:02 +0000)
(thank you LLVM static analyzer...)
src/dinitctl.cc
patch
|
blob
|
history
diff --git
a/src/dinitctl.cc
b/src/dinitctl.cc
index 742b2de0acce87536656061a1bd119cae1088d9f..8a7f111e53b9bad2c73676cd8ec6cf1ac8232d53 100644
(file)
--- a/
src/dinitctl.cc
+++ b/
src/dinitctl.cc
@@
-293,7
+293,7
@@
int main(int argc, char **argv)
buf[1] = do_pin ? 1 : 0;
memcpy(buf + 2, &handle, sizeof(handle));
r = write_all(socknum, buf, 2 + sizeof(handle));
- delete buf;
+ delete
[]
buf;
if (r == -1) {
perror("write");
@@
-458,7
+458,7
@@
static int unpinService(int socknum, const char *service_name)
buf[0] = DINIT_CP_UNPINSERVICE;
memcpy(buf + 1, &handle, sizeof(handle));
r = write_all(socknum, buf, 2 + sizeof(handle));
- delete buf;
+ delete
[]
buf;
if (r == -1) {
perror("write");