summaryrefslogtreecommitdiffstats
path: root/clang/tools/c-index-test
diff options
context:
space:
mode:
authorEli Bendersky <eliben@google.com>2014-08-01 12:55:44 +0000
committerEli Bendersky <eliben@google.com>2014-08-01 12:55:44 +0000
commit78e83d8895384096a8dfca0c2b3b3d7ae5282811 (patch)
treea454b43f02cc9c816284e00205efa6e5dfb13aba /clang/tools/c-index-test
parent137ce60ecfe86a6b9b99ccbb42493f4bced7bbcf (diff)
downloadbcm5719-llvm-78e83d8895384096a8dfca0c2b3b3d7ae5282811.tar.gz
bcm5719-llvm-78e83d8895384096a8dfca0c2b3b3d7ae5282811.zip
Fix a memory leak - dispose of the CXString after printing it in mangling.
Thanks to kcc@ for noticing. llvm-svn: 214506
Diffstat (limited to 'clang/tools/c-index-test')
-rw-r--r--clang/tools/c-index-test/c-index-test.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c
index b1d4a4d883d..08cf69b6f60 100644
--- a/clang/tools/c-index-test/c-index-test.c
+++ b/clang/tools/c-index-test/c-index-test.c
@@ -1372,6 +1372,7 @@ static enum CXChildVisitResult PrintMangledName(CXCursor cursor, CXCursor p,
PrintCursor(cursor, NULL);
MangledName = clang_Cursor_getMangling(cursor);
printf(" [mangled=%s]\n", clang_getCString(MangledName));
+ clang_disposeString(MangledName);
return CXChildVisit_Continue;
}
OpenPOWER on IntegriCloud