[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [dferry] serialization: Fix mismatched (new / malloc) / (delete / free) found by valgrind.
From:       Andreas Hartmetz <ahartmetz () gmail ! com>
Date:       2016-10-12 1:11:29
Message-ID: E1bu84v-0007MI-Kk () code ! kde ! org
[Download RAW message or body]

Git commit 5766752aa84394433fc92164bcb0dd6072d83097 by Andreas Hartmetz.
Committed on 12/10/2016 at 01:09.
Pushed by ahartmetz into branch 'master'.

Fix mismatched (new / malloc) / (delete / free) found by valgrind.

So the just added tests did find something after all.

M  +1    -1    serialization/arguments.cpp

http://commits.kde.org/dferry/5766752aa84394433fc92164bcb0dd6072d83097

diff --git a/serialization/arguments.cpp b/serialization/arguments.cpp
index 1e9b97c..0e7c5a5 100644
--- a/serialization/arguments.cpp
+++ b/serialization/arguments.cpp
@@ -1807,7 +1807,7 @@ Arguments::Writer::Writer(const Writer &other)
      m_u(other.m_u)
 {
     if (other.d) {
-        d = new Private(*other.d);
+        d = new(allocCaches.writerPrivate.allocate()) Private(*other.d);
     }
 
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic