mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 1462049: Fix MemStream allocation to only allocate its capacity. r=jrmuizel
This commit is contained in:
parent
344259ad39
commit
8a6b8bfbbf
@ -193,11 +193,11 @@ struct MemStream {
|
||||
if (mLength > mCapacity) {
|
||||
mCapacity = mCapacity * 2;
|
||||
// check if the doubled capacity is enough
|
||||
// otherwise use mLength
|
||||
// otherwise use double mLength
|
||||
if (mLength > mCapacity) {
|
||||
mCapacity = mLength;
|
||||
mCapacity = mLength * 2;
|
||||
}
|
||||
mData = (char*)realloc(mData, mCapacity * 2);
|
||||
mData = (char*)realloc(mData, mCapacity);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user