[haiku-commits] haiku: hrev53574 - src/add-ons/kernel/file_systems/netfs/shared

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 5 Nov 2019 07:46:27 -0500 (EST)

hrev53574 adds 1 changeset to branch 'master'
old head: 715a29f47d9365b5aaf388a8723876521171dc59
new head: 61b433252a46c552c07b1516d4c750063fcf0d77
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=61b433252a46+%5E715a29f47d93

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

61b433252a46: Netfs: Fix memory error
  
  In Reader::Read(), memory is allocated to '*buffer' at line 40,
  but freed with 'buffer' at line 45.
  Pointed by Clang Static Analyzer.
  
  Change-Id: I18e49791da639a6bc2041e944a39ceb73a2e5055
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/1931
  Reviewed-by: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>

                                      [ Murai Takashi <tmurai01@xxxxxxxxx> ]

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

Revision:    hrev53574
Commit:      61b433252a46c552c07b1516d4c750063fcf0d77
URL:         https://git.haiku-os.org/haiku/commit/?id=61b433252a46
Author:      Murai Takashi <tmurai01@xxxxxxxxx>
Date:        Wed Oct 30 11:22:23 2019 UTC
Committer:   Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
Commit-Date: Tue Nov  5 12:46:22 2019 UTC

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

1 file changed, 1 insertion(+), 1 deletion(-)
src/add-ons/kernel/file_systems/netfs/shared/RequestUnflattener.cpp | 2 +-

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

diff --git 
a/src/add-ons/kernel/file_systems/netfs/shared/RequestUnflattener.cpp 
b/src/add-ons/kernel/file_systems/netfs/shared/RequestUnflattener.cpp
index 41c99416c5..e682d68bfe 100644
--- a/src/add-ons/kernel/file_systems/netfs/shared/RequestUnflattener.cpp
+++ b/src/add-ons/kernel/file_systems/netfs/shared/RequestUnflattener.cpp
@@ -42,7 +42,7 @@ Reader::Read(int32 size, void** buffer, bool* mustFree)
                return B_NO_MEMORY;
        status_t error = Read(*buffer, size);
        if (error != B_OK) {
-               free(buffer);
+               free(*buffer);
                return error;
        }
        return error;


Other related posts:

  • » [haiku-commits] haiku: hrev53574 - src/add-ons/kernel/file_systems/netfs/shared - Axel Dörfler