From bc759e0e9e916d7d70c2ec0b485337f12231dbf3 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Thu, 14 Jan 2016 10:02:40 +0000 Subject: [PATCH] Use delete[] to delete buffers allocated via new[] (thank you LLVM static analyzer...) --- src/dinitctl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dinitctl.cc b/src/dinitctl.cc index 742b2de..8a7f111 100644 --- 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"); -- 2.25.1