DFG::FunctionWhitelist::parseFunctionNamesInFile does not close file
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jun 2014 15:30:23 +0000 (15:30 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jun 2014 15:30:23 +0000 (15:30 +0000)
<http://webkit.org/b/134343>
<rdar://problem/17459487>

Reviewed by Michael Saboff.

* dfg/DFGFunctionWhitelist.cpp:
(JSC::DFG::FunctionWhitelist::parseFunctionNamesInFile):
Close the file handle, and log an error on failure.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170480 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGFunctionWhitelist.cpp

index 94c0170b91dd2fb2509b68c2cf4ba54bd7d104c8..9884e9cb898efd6731062fd0d37bb59603aca2ee 100644 (file)
@@ -1,3 +1,15 @@
+2014-06-26  David Kilzer  <ddkilzer@apple.com>
+
+        DFG::FunctionWhitelist::parseFunctionNamesInFile does not close file
+        <http://webkit.org/b/134343>
+        <rdar://problem/17459487>
+
+        Reviewed by Michael Saboff.
+
+        * dfg/DFGFunctionWhitelist.cpp:
+        (JSC::DFG::FunctionWhitelist::parseFunctionNamesInFile):
+        Close the file handle, and log an error on failure.
+
 2014-06-25  Dana Burkart  <dburkart@apple.com>
 
         Add support for 5-tuple versioning.
index 0bcb4a01133bd45cc4bd7321079269aea83fcb8a..c003f4ca86dfcf0727aa0290432aae4ce598ef05 100644 (file)
@@ -81,6 +81,10 @@ void FunctionWhitelist::parseFunctionNamesInFile(const char* filename)
         
         m_entries.add(String(line, length));
     }
+
+    int result = fclose(f);
+    if (result)
+        dataLogF("Failed to close file %s: %s\n", filename, strerror(errno));
 }
 
 bool FunctionWhitelist::contains(CodeBlock* codeBlock) const