[PATCH] D49666: [profile] Fix a possible memory leak in parseFilenamePattern().
Igor Kudrin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 23 04:55:26 PDT 2018
ikudrin created this revision.
ikudrin added a reviewer: davidxl.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D49666
Files:
lib/profile/InstrProfilingFile.c
Index: lib/profile/InstrProfilingFile.c
===================================================================
--- lib/profile/InstrProfilingFile.c
+++ lib/profile/InstrProfilingFile.c
@@ -318,12 +318,12 @@
if (lprofCurFilename.Filename)
free((void *)lprofCurFilename.Filename);
- memset(&lprofCurFilename, 0, sizeof(lprofCurFilename));
-
if (lprofCurFilename.FilenamePat && lprofCurFilename.OwnsFilenamePat) {
free((void *)lprofCurFilename.FilenamePat);
}
+ memset(&lprofCurFilename, 0, sizeof(lprofCurFilename));
+
if (!CopyFilenamePat)
lprofCurFilename.FilenamePat = FilenamePat;
else {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49666.156752.patch
Type: text/x-patch
Size: 623 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180723/41cc72c4/attachment.bin>
More information about the llvm-commits
mailing list