[cfe-commits] r111559 - /cfe/trunk/tools/c-index-test/c-index-test.c

Douglas Gregor dgregor at apple.com
Thu Aug 19 13:50:29 PDT 2010


Author: dgregor
Date: Thu Aug 19 15:50:29 2010
New Revision: 111559

URL: http://llvm.org/viewvc/llvm-project?rev=111559&view=rev
Log:
Fix a c-index-test leak with file remapping

Modified:
    cfe/trunk/tools/c-index-test/c-index-test.c

Modified: cfe/trunk/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=111559&r1=111558&r2=111559&view=diff
==============================================================================
--- cfe/trunk/tools/c-index-test/c-index-test.c (original)
+++ cfe/trunk/tools/c-index-test/c-index-test.c Thu Aug 19 15:50:29 2010
@@ -64,6 +64,7 @@
     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 @@
     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;





More information about the cfe-commits mailing list