summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-05-22 23:29:16 +0000
committerGreg Clayton <gclayton@apple.com>2013-05-22 23:29:16 +0000
commitfdbdc9c0ff3ffe090533524f4c2691118f1dc52f (patch)
tree1caefa3a6761439012aca1a4adabe783070bf014
parent3821723c326c6c85b383530a83704894a2492db3 (diff)
downloadbcm5719-llvm-fdbdc9c0ff3ffe090533524f4c2691118f1dc52f.tar.gz
bcm5719-llvm-fdbdc9c0ff3ffe090533524f4c2691118f1dc52f.zip
Fixed a file leak introduced with my last checkin. Also be sure to include <stdio.h> just in case.
llvm-svn: 182537
-rw-r--r--lldb/source/Interpreter/PythonDataObjects.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lldb/source/Interpreter/PythonDataObjects.cpp b/lldb/source/Interpreter/PythonDataObjects.cpp
index d8720568803..ad830ed9db6 100644
--- a/lldb/source/Interpreter/PythonDataObjects.cpp
+++ b/lldb/source/Interpreter/PythonDataObjects.cpp
@@ -15,6 +15,8 @@
#else
+#include <stdio.h>
+
#if defined (__APPLE__)
#include <Python/Python.h>
#else
@@ -43,19 +45,20 @@ PythonObject::Dump (Stream &strm) const
{
if (m_py_obj)
{
- FILE *file = tmpfile();
+ FILE *file = ::tmpfile();
if (file)
{
- PyObject_Print (m_py_obj, file, 0);
+ ::PyObject_Print (m_py_obj, file, 0);
const long length = ftell (file);
if (length)
{
- rewind(file);
+ ::rewind(file);
std::vector<char> file_contents (length,'\0');
- const size_t length_read = fread(file_contents.data(), 1, file_contents.size(), file);
+ const size_t length_read = ::fread (file_contents.data(), 1, file_contents.size(), file);
if (length_read > 0)
- strm.Write(file_contents.data(), length_read);
+ strm.Write (file_contents.data(), length_read);
}
+ ::fclose (file);
}
}
else
OpenPOWER on IntegriCloud