Fix minor issue in BString I noticed when researching #7226:
* if _MakeWritable() fails, LockBuffer() must return NULL, not what happens to be in fPrivateData git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40525 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
c44a2a9a25
commit
9f209e77b8
@ -1787,10 +1787,12 @@ BString::LockBuffer(int32 maxLength)
|
||||
if (maxLength > length)
|
||||
length = maxLength;
|
||||
|
||||
if (_MakeWritable(length, true) == B_OK) {
|
||||
_ReferenceCount() = -1;
|
||||
// mark unshareable
|
||||
}
|
||||
if (_MakeWritable(length, true) != B_OK)
|
||||
return NULL;
|
||||
|
||||
_ReferenceCount() = -1;
|
||||
// mark unshareable
|
||||
|
||||
return fPrivateData;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user