From 6156ef9f9433557d8e5dcca69470f01968d9cb4d Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 9 Jun 2015 10:15:52 +0200 Subject: [PATCH] Bug 1172824: Close dumpFile in case of error in DumpHeap (CID 1302587); r=jonco --- js/src/builtin/TestingFunctions.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index e38d4bcfb5b..9883f63486e 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -1121,6 +1121,8 @@ DumpHeap(JSContext* cx, unsigned argc, Value* vp) if (i != args.length()) { JS_ReportError(cx, "bad arguments passed to dumpHeap"); + if (dumpFile) + fclose(dumpFile); return false; }