Commit f10bc461 authored by Jan de Mooij's avatar Jan de Mooij
Browse files

Bug 1780155 - Remove unnecessary + 1 in StringBuffer ExtractWellSized. r=sfink

This probably goes back to null-terminated strings.

Differential Revision: https://phabricator.services.mozilla.com/D152146
parent 4ba91ba3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ static CharT* ExtractWellSized(Buffer& cb) {
  /* For medium/big buffers, avoid wasting more than 1/4 of the memory. */
  MOZ_ASSERT(capacity >= length);
  if (length > Buffer::sMaxInlineStorage && capacity - length > length / 4) {
    CharT* tmp = allocPolicy.pod_realloc<CharT>(buf, capacity, length + 1);
    CharT* tmp = allocPolicy.pod_realloc<CharT>(buf, capacity, length);
    if (!tmp) {
      allocPolicy.free_(buf);
      return nullptr;