[haiku-commits] haiku: hrev43600 - src/preferences/time

  • From: stpere@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 2 Jan 2012 22:54:17 +0100 (CET)

hrev43600 adds 1 changeset to branch 'master'
old head: 93f68d97bf912e963e4390a606d1baaf234b57a5
new head: 0106325bc4c526030732490d88ad3d1778b20121

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

0106325: Time preference: Fix a memory leak
  
  Accidentally introduced with an earlier commit.

                                [ Philippe Saint-Pierre <stpere@xxxxxxxxx> ]

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

Revision:    hrev43600
Commit:      0106325bc4c526030732490d88ad3d1778b20121
URL:         http://cgit.haiku-os.org/haiku/commit/?id=0106325
Author:      Philippe Saint-Pierre <stpere@xxxxxxxxx>
Date:        Mon Jan  2 21:52:52 2012 UTC

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

1 files changed, 3 insertions(+), 1 deletions(-)
src/preferences/time/NetworkTimeView.cpp |    4 +++-

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

diff --git a/src/preferences/time/NetworkTimeView.cpp 
b/src/preferences/time/NetworkTimeView.cpp
index f5b8297..8e85b1c 100644
--- a/src/preferences/time/NetworkTimeView.cpp
+++ b/src/preferences/time/NetworkTimeView.cpp
@@ -175,8 +175,10 @@ Settings::SettingsChanged()
                return true;
        fOldMessage.Flatten(oldBytes, oldSize);
        char* newBytes = new (std::nothrow) char[newSize];
-       if (newBytes == NULL)
+       if (newBytes == NULL) {
+               delete[] oldBytes;
                return true;
+       }
        fMessage.Flatten(newBytes, newSize);
        
        int result = memcmp(oldBytes, newBytes, oldSize);


Other related posts:

  • » [haiku-commits] haiku: hrev43600 - src/preferences/time - stpere