Changeset 207842 in webkit


Ignore:
Timestamp:
Oct 25, 2016 1:33:46 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

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 <Christopher.Reid@am.sony.com> on 2016-10-25
Reviewed by Mark Lam.

  • jsc.cpp:
Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r207831 r207842  
     12016-10-25  Christopher Reid  <Christopher.Reid@am.sony.com>
     2
     3        jsc.cpp is leaking memory allocated by readline in runInteractive
     4        https://bugs.webkit.org/show_bug.cgi?id=163958
     5
     6        According to http://web.mit.edu/gnu/doc/html/rlman_2.html,
     7        "The line readline returns is allocated with malloc ();
     8        you should free () the line when you are done with it."
     9        The memory allocated by readline is not being freed when it should.
     10
     11        Reviewed by Mark Lam.
     12
     13        * jsc.cpp:
     14
    1152016-10-25  Konstantin Tokarev  <annulen@yandex.ru>
    216
  • trunk/Source/JavaScriptCore/jsc.cpp

    r207787 r207842  
    26302630            source = source + '\n';
    26312631            checkSyntax(globalObject->vm(), makeSource(source, interpreterName), error);
    2632             if (!line[0])
     2632            if (!line[0]) {
     2633                free(line);
    26332634                break;
     2635            }
    26342636            add_history(line);
     2637            free(line);
    26352638        } while (error.syntaxErrorType() == ParserError::SyntaxErrorRecoverable);
    26362639       
Note: See TracChangeset for help on using the changeset viewer.