aboutsummaryrefslogtreecommitdiff
path: root/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-19 20:50:29 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-19 20:50:29 +0000
commit653a55f4bc0cb1d0c1f3ff86e9559f744eb3c18f (patch)
treea8116fe4e9c4001b796c2cfe340f42967406b41f /tools/c-index-test/c-index-test.c
parent4786c15f4977c7cee98fde3ebdee213dba23848b (diff)
Fix a c-index-test leak with file remapping
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111559 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/c-index-test/c-index-test.c')
-rw-r--r--tools/c-index-test/c-index-test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index c822a135c2..2c4a3386df 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -64,6 +64,7 @@ void free_remapped_files(struct CXUnsavedFile *unsaved_files,
free((char *)unsaved_files[i].Filename);
free((char *)unsaved_files[i].Contents);
}
+ free(unsaved_files);
}
int parse_remapped_files(int argc, const char **argv, int start_arg,
@@ -87,8 +88,8 @@ int parse_remapped_files(int argc, const char **argv, int start_arg,
return 0;
*unsaved_files
- = (struct CXUnsavedFile *)malloc(sizeof(struct CXUnsavedFile) *
- *num_unsaved_files);
+ = (struct CXUnsavedFile *)malloc(sizeof(struct CXUnsavedFile) *
+ *num_unsaved_files);
for (arg = start_arg, i = 0; i != *num_unsaved_files; ++i, ++arg) {
struct CXUnsavedFile *unsaved = *unsaved_files + i;
const char *arg_string = argv[arg] + prefix_len;