diff options
| author | Ted Kremenek <kremenek@apple.com> | 2009-10-20 05:25:11 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2009-10-20 05:25:11 +0000 |
| commit | 2f9876cf7c3b616840680e86c0b289b830fa7626 (patch) | |
| tree | 45144630640a96b4d4a62be91db41734f7132d4e /clang | |
| parent | f0b3d15cfed9d3a539a95e226560865769620881 (diff) | |
| download | bcm5719-llvm-2f9876cf7c3b616840680e86c0b289b830fa7626.tar.gz bcm5719-llvm-2f9876cf7c3b616840680e86c0b289b830fa7626.zip | |
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
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Rewrite/RewriteRope.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Rewrite/RewriteRope.cpp b/clang/lib/Rewrite/RewriteRope.cpp index 30bbcfafb53..bd99732dc87 100644 --- a/clang/lib/Rewrite/RewriteRope.cpp +++ b/clang/lib/Rewrite/RewriteRope.cpp @@ -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); } |

