jsc.cpp is leaking memory allocated by readline in runInteractive
[WebKit-https.git] / Source / JavaScriptCore / jsc.cpp
index 5eb4d04..a0396aa 100644 (file)
@@ -2629,9 +2629,12 @@ static void runInteractive(GlobalObject* globalObject)
             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()) {