[haiku-commits] haiku: hrev53788 - src/servers/app

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 28 Jan 2020 13:01:20 -0500 (EST)

hrev53788 adds 1 changeset to branch 'master'
old head: 88d73c6cf84541c711c44cb65cf36156fe040cc9
new head: 2afe4c52c897e672b9f09532094232011a2684b9
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=2afe4c52c897+%5E88d73c6cf845

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

2afe4c52c897: appserver: Fix PVS V595
  
  Add NULL check for fAllocator, since it might return NULL.
  
  Change-Id: Ifb72266b4d4c5f076f0c663066dc9b81e94fc201
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/2162
  Reviewed-by: Stephan Aßmus <superstippi@xxxxxx>

                                      [ Murai Takashi <tmurai01@xxxxxxxxx> ]

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

Revision:    hrev53788
Commit:      2afe4c52c897e672b9f09532094232011a2684b9
URL:         https://git.haiku-os.org/haiku/commit/?id=2afe4c52c897
Author:      Murai Takashi <tmurai01@xxxxxxxxx>
Date:        Sun Jan 26 11:16:01 2020 UTC
Committer:   Stephan Aßmus <superstippi@xxxxxx>
Commit-Date: Tue Jan 28 18:01:14 2020 UTC

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

1 file changed, 4 insertions(+), 3 deletions(-)
src/servers/app/ClientMemoryAllocator.cpp | 7 ++++---

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

diff --git a/src/servers/app/ClientMemoryAllocator.cpp 
b/src/servers/app/ClientMemoryAllocator.cpp
index 746f12cfd9..cb07609bc3 100644
--- a/src/servers/app/ClientMemoryAllocator.cpp
+++ b/src/servers/app/ClientMemoryAllocator.cpp
@@ -324,10 +324,11 @@ ClientMemory::ClientMemory()
 
 ClientMemory::~ClientMemory()
 {
-       if (fBlock != NULL)
-               fAllocator->Free(fBlock);
-       if (fAllocator != NULL)
+       if (fAllocator != NULL) {
+               if (fBlock != NULL)
+                       fAllocator->Free(fBlock);
                fAllocator->ReleaseReference();
+       }
 }
 
 


Other related posts:

  • » [haiku-commits] haiku: hrev53788 - src/servers/app - Stephan Aßmus