Fix a reference count imbalance in RewriteRope::MakeRopeString().
This was causing a ton of memory to be leaked when using HTML diagnostics with the static analyzer (on large files with many errors). llvm-svn: 84601
This commit is contained in:
parent
f0b3d15cfe
commit
2f9876cf7c
|
@ -798,9 +798,8 @@ RopePiece RewriteRope::MakeRopeString(const char *Start, const char *End) {
|
|||
memcpy(AllocBuffer->Data, Start, Len);
|
||||
AllocOffs = Len;
|
||||
|
||||
// Start out the new allocation with a refcount of 1, since we have an
|
||||
// internal reference to it.
|
||||
AllocBuffer->addRef();
|
||||
// Return a RopePiece that wraps 'AllocBuffer'. The constructor of RopePiece
|
||||
// will increment the reference count of AllocBuffer.
|
||||
return RopePiece(AllocBuffer, 0, Len);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue