[haiku-commits] haiku: hrev53274 - in src: system/kernel/vm kits/storage/sniffer add-ons/print/drivers/pcl6

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 17 Jul 2019 18:09:12 -0400 (EDT)

hrev53274 adds 1 changeset to branch 'master'
old head: ff38df48cfb21b95fb2dce0443762e0e470db57c
new head: e081b9cd7ef168847177a491da56ccb1c69d57cb
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=e081b9cd7ef1+%5Eff38df48cfb2

----------------------------------------------------------------------------

e081b9cd7ef1: PVS V611: Use delete [] for memory allocated by new [].
  
  Change-Id: I712350ae7f742aaa8e0ea58186265fac4bbac73e
  Reviewed-on: https://review.haiku-os.org/c/1627
  Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

                                      [ Murai Takashi <tmurai01@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev53274
Commit:      e081b9cd7ef168847177a491da56ccb1c69d57cb
URL:         https://git.haiku-os.org/haiku/commit/?id=e081b9cd7ef1
Author:      Murai Takashi <tmurai01@xxxxxxxxx>
Date:        Wed Jul 17 21:26:14 2019 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Wed Jul 17 22:09:10 2019 UTC

----------------------------------------------------------------------------

3 files changed, 5 insertions(+), 5 deletions(-)
src/add-ons/print/drivers/pcl6/PCL6Rasterizer.h | 2 +-
src/kits/storage/sniffer/Err.cpp                | 4 ++--
src/system/kernel/vm/vm_page.cpp                | 4 ++--

----------------------------------------------------------------------------

diff --git a/src/add-ons/print/drivers/pcl6/PCL6Rasterizer.h 
b/src/add-ons/print/drivers/pcl6/PCL6Rasterizer.h
index d3f474bf1d..b14b6f892e 100644
--- a/src/add-ons/print/drivers/pcl6/PCL6Rasterizer.h
+++ b/src/add-ons/print/drivers/pcl6/PCL6Rasterizer.h
@@ -23,7 +23,7 @@ public:
        
                                                ~PCL6Rasterizer()
                                                {
-                                                       delete fOutBuffer;
+                                                       delete[] fOutBuffer;
                                                        fOutBuffer = NULL;
                                                }
        
diff --git a/src/kits/storage/sniffer/Err.cpp b/src/kits/storage/sniffer/Err.cpp
index 102c91f31f..4cbed73933 100644
--- a/src/kits/storage/sniffer/Err.cpp
+++ b/src/kits/storage/sniffer/Err.cpp
@@ -62,7 +62,7 @@ Err::SetTo(const std::string &msg, const ssize_t pos) {
 
 void
 Err::Unset() {
-       delete fMsg;
+       delete[] fMsg;
        fMsg = NULL;
        fPos = -1;
 }
@@ -80,7 +80,7 @@ Err::Pos() const {
 void
 Err::SetMsg(const char *msg) {
        if (fMsg) {
-               delete fMsg;
+               delete[] fMsg;
                fMsg = NULL;
        } 
        if (msg) {
diff --git a/src/system/kernel/vm/vm_page.cpp b/src/system/kernel/vm/vm_page.cpp
index 4478856240..dc73fef568 100644
--- a/src/system/kernel/vm/vm_page.cpp
+++ b/src/system/kernel/vm/vm_page.cpp
@@ -3077,8 +3077,8 @@ vm_page_write_modified_page_range(struct VMCache* cache, 
uint32 firstPage,
                = new(malloc_flags(allocationFlags)) 
PageWriteWrapper*[maxPages];
        if (wrapperPool == NULL || wrappers == NULL) {
                // don't fail, just limit our capabilities
-               free(wrapperPool);
-               free(wrappers);
+               delete[] wrapperPool;
+               delete[] wrappers;
                wrapperPool = stackWrappersPool;
                wrappers = stackWrappers;
                maxPages = 1;


Other related posts:

  • » [haiku-commits] haiku: hrev53274 - in src: system/kernel/vm kits/storage/sniffer add-ons/print/drivers/pcl6 - waddlesplash