summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorStephane Sezer <sas@cd80.net>2016-03-25 23:40:32 +0000
committerStephane Sezer <sas@cd80.net>2016-03-25 23:40:32 +0000
commit65fd8f4345e841bcbe68c53b2f808eb53e4bf24e (patch)
treea17d4bd3017f9e5c5785cb2c2b2dc5e3f315143f /llvm/lib/Object/MachOObjectFile.cpp
parent412989750ddebeb7022ae82df6b8fcb51c47d85a (diff)
downloadbcm5719-llvm-65fd8f4345e841bcbe68c53b2f808eb53e4bf24e.tar.gz
bcm5719-llvm-65fd8f4345e841bcbe68c53b2f808eb53e4bf24e.zip
Fix FILE * leak in Python API
Summary: This fixes a leak introduced by some of these changes: r257644 r250530 r250525 The changes made in these patches result in leaking the FILE* passed to SetImmediateOutputFile. GetStream() will dup() the fd held by the python caller and create a new FILE*. It will then pass this FILE* to SetImmediateOutputFile, which always uses the flag transfer_ownership=false when it creates a File from the FILE*. Since transfer_ownership is false, the lldb File destructor will not close the underlying FILE*. Because this FILE* came from a dup-ed fd, it will also not be closed when the python caller closes its file. Leaking the FILE* causes issues if the same file is used multiple times by different python callers during the same lldb run, even if these callers open and close the python file properly, as you can end up with issues due to multiple buffered writes to the same file. Reviewers: granata.enrico, zturner, clayborg Subscribers: zturner, lldb-commits, sas Differential Revision: http://reviews.llvm.org/D18459 Change by Francis Ricci <fjricci@fb.com> llvm-svn: 264476
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud