hrev50962 adds 1 changeset to branch 'master'
old head: 7abafe9f3ff222073b2fd25ab5748a5e1fdb36ae
new head: a90df70af5e20d5af156fd714546428739cc8eef
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=a90df70af5e2+%5E7abafe9f3ff2
----------------------------------------------------------------------------
a90df70af5e2: bfs: Fixed leaking cookie regression.
* Introduced with the last commit.
[ Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev50962
Commit: a90df70af5e20d5af156fd714546428739cc8eef
URL: http://cgit.haiku-os.org/haiku/commit/?id=a90df70af5e2
Author: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
Date: Sun Feb 19 17:21:00 2017 UTC
----------------------------------------------------------------------------
1 file changed, 7 insertions(+), 6 deletions(-)
src/add-ons/kernel/file_systems/bfs/Attribute.cpp | 13 +++++++------
----------------------------------------------------------------------------
diff --git a/src/add-ons/kernel/file_systems/bfs/Attribute.cpp
b/src/add-ons/kernel/file_systems/bfs/Attribute.cpp
index 93c3434..3347e64 100644
--- a/src/add-ons/kernel/file_systems/bfs/Attribute.cpp
+++ b/src/add-ons/kernel/file_systems/bfs/Attribute.cpp
@@ -3,7 +3,8 @@
* This file may be used under the terms of the MIT License.
*/
-//! connection between pure inode and kernel_interface attributes
+
+//! Connection between pure inode and kernel_interface attributes.
#include "Attribute.h"
@@ -120,17 +121,17 @@ Attribute::Create(const char* name, type_code type, int
openMode,
attr_cookie** _cookie)
{
status_t status = CheckAccess(name, openMode);
- if (status < B_OK)
+ if (status != B_OK)
return status;
- attr_cookie* cookie = new(std::nothrow) attr_cookie;
- if (cookie == NULL)
- RETURN_ERROR(B_NO_MEMORY);
-
bool exists = Get(name) == B_OK;
if (exists && (openMode & O_EXCL) != 0)
return B_FILE_EXISTS;
+ attr_cookie* cookie = new(std::nothrow) attr_cookie;
+ if (cookie == NULL)
+ RETURN_ERROR(B_NO_MEMORY);
+
fName = name;
// initialize the cookie