[all-commits] [llvm/llvm-project] 2b1ebe: Fixed small memory leak in libprofile (#141739)

gbMattN via All-commits all-commits at lists.llvm.org
Wed May 28 06:52:12 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2b1ebef8b8a5af7092de80daafd2743683d0e8c8
      https://github.com/llvm/llvm-project/commit/2b1ebef8b8a5af7092de80daafd2743683d0e8c8
  Author: gbMattN <matthew.nagy at sony.com>
  Date:   2025-05-28 (Wed, 28 May 2025)

  Changed paths:
    M compiler-rt/lib/profile/InstrProfilingFile.c

  Log Message:
  -----------
  Fixed small memory leak in libprofile (#141739)

Inside `getCurFilename`, there is this code snippit
```
if (!lprofCurFilename.FilenamePat || !lprofCurFilename.FilenamePat[0])
    return 0;
```
If this is true, we return `"\0"`, but would leak the memory in
`FilenameBuf`.
This pull request adds a free before then to properly free the memory.
There was already a check that we allocated memory, so there is no need
to worry about freeing unallocated memory.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list