Title: [207986] releases/WebKitGTK/webkit-2.14/Source/_javascript_Core
Revision
207986
Author
[email protected]
Date
2016-10-27 03:59:16 -0700 (Thu, 27 Oct 2016)

Log Message

Merge r207842 - jsc.cpp is leaking memory allocated by readline in runInteractive
https://bugs.webkit.org/show_bug.cgi?id=163958

According to http://web.mit.edu/gnu/doc/html/rlman_2.html,
"The line readline returns is allocated with malloc ();
you should free () the line when you are done with it."
The memory allocated by readline is not being freed when it should.

Patch by Christopher Reid <[email protected]> on 2016-10-25
Reviewed by Mark Lam.

* jsc.cpp:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.14/Source/_javascript_Core/ChangeLog (207985 => 207986)


--- releases/WebKitGTK/webkit-2.14/Source/_javascript_Core/ChangeLog	2016-10-27 10:56:19 UTC (rev 207985)
+++ releases/WebKitGTK/webkit-2.14/Source/_javascript_Core/ChangeLog	2016-10-27 10:59:16 UTC (rev 207986)
@@ -1,3 +1,17 @@
+2016-10-25  Christopher Reid  <[email protected]>
+
+        jsc.cpp is leaking memory allocated by readline in runInteractive
+        https://bugs.webkit.org/show_bug.cgi?id=163958
+
+        According to http://web.mit.edu/gnu/doc/html/rlman_2.html,
+        "The line readline returns is allocated with malloc ();
+        you should free () the line when you are done with it."
+        The memory allocated by readline is not being freed when it should.
+
+        Reviewed by Mark Lam.
+
+        * jsc.cpp:
+
 2016-10-20  Zan Dobersek  <[email protected]>
 
         Fix JSC cast-align compiler warnings on ARMv7

Modified: releases/WebKitGTK/webkit-2.14/Source/_javascript_Core/jsc.cpp (207985 => 207986)


--- releases/WebKitGTK/webkit-2.14/Source/_javascript_Core/jsc.cpp	2016-10-27 10:56:19 UTC (rev 207985)
+++ releases/WebKitGTK/webkit-2.14/Source/_javascript_Core/jsc.cpp	2016-10-27 10:59:16 UTC (rev 207986)
@@ -2247,9 +2247,12 @@
             source = source + line;
             source = source + '\n';
             checkSyntax(globalObject->vm(), makeSource(source, interpreterName), error);
-            if (!line[0])
+            if (!line[0]) {
+                free(line);
                 break;
+            }
             add_history(line);
+            free(line);
         } while (error.syntaxErrorType() == ParserError::SyntaxErrorRecoverable);
         
         if (error.isValid()) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to