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:
@@ -1787,10 +1787,12 @@ BString::LockBuffer(int32 maxLength)
|
|||||||
if (maxLength > length)
|
if (maxLength > length)
|
||||||
length = maxLength;
|
length = maxLength;
|
||||||
|
|
||||||
if (_MakeWritable(length, true) == B_OK) {
|
if (_MakeWritable(length, true) != B_OK)
|
||||||
_ReferenceCount() = -1;
|
return NULL;
|
||||||
// mark unshareable
|
|
||||||
}
|
_ReferenceCount() = -1;
|
||||||
|
// mark unshareable
|
||||||
|
|
||||||
return fPrivateData;
|
return fPrivateData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user