]> granicus.if.org Git - clang/commitdiff
Don't leak CXStrings for replacement fix-its in c-index-test.
authorNico Weber <nicolasweber@gmx.de>
Sat, 10 May 2014 23:56:43 +0000 (23:56 +0000)
committerNico Weber <nicolasweber@gmx.de>
Sat, 10 May 2014 23:56:43 +0000 (23:56 +0000)
The loop body used to contain a switch statement; it looks like r96685 replaced
that with an if/else if/else but accidentally left one of the three break
statements from the switch behind, skipping the clang_disposeString() call
for replacements (and the rest of the loop too, which apparently doesn't make
a differences for the test cases we have).

r96685: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100215/027754.html

This too might possibly the last leak in clang (PR19521).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208483 91177308-0d34-0410-b5e6-96231b3b80d8

tools/c-index-test/c-index-test.c

index fd2b120f4159690caa3d4e8ce5ad4974701dbc69..99f291ddd7e66ad5f209a69b5f2e4dc4a4bdbfb7 100644 (file)
@@ -977,7 +977,6 @@ void PrintDiagnostic(CXDiagnostic Diagnostic) {
         PrintExtent(out, start_line, start_column, end_line, end_column);
         fprintf(out, " with \"%s\"\n", clang_getCString(insertion_text));
       }
-      break;
     }
     clang_disposeString(insertion_text);
   }