[compiler-rt] r242350 - [probile] Fix memory leak introduced in r241824.

Alexey Samsonov vonosmas at gmail.com
Wed Jul 15 15:50:39 PDT 2015


Author: samsonov
Date: Wed Jul 15 17:50:39 2015
New Revision: 242350

URL: http://llvm.org/viewvc/llvm-project?rev=242350&view=rev
Log:
[probile] Fix memory leak introduced in r241824.

Modified:
    compiler-rt/trunk/lib/profile/InstrProfilingFile.c

Modified: compiler-rt/trunk/lib/profile/InstrProfilingFile.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingFile.c?rev=242350&r1=242349&r2=242350&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingFile.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingFile.c Wed Jul 15 17:50:39 2015
@@ -90,6 +90,7 @@ static void truncateCurrentFile(void) {
     char *Copy = malloc(strlen(Filename) + 1);
     strcpy(Copy, Filename);
     __llvm_profile_recursive_mkdir(Copy);
+    free(Copy);
   }
 
   /* Truncate the file.  Later we'll reopen and append. */





More information about the llvm-commits mailing list