Bug 1462049: Fix MemStream allocation to only allocate its capacity. r=jrmuizel

This commit is contained in:
Bob Owen 2018-05-16 18:26:24 +01:00
Родитель 344259ad39
Коммит 8a6b8bfbbf
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -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);
}
}