⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 207986 in webkit


Ignore:
Timestamp:
Oct 27, 2016, 3:59:16 AM (10 years ago)
Author:
Carlos Garcia Campos
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 <​Christopher.Reid@am.sony.com> on 2016-10-25
Reviewed by Mark Lam.

  • jsc.cpp:
Location:
releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/ChangeLog

    r207983 r207986  
     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-20  Zan Dobersek  <zdobersek@igalia.com>
    216
  • releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/jsc.cpp

    r207066 r207986  
    22482248            source = source + '\n';
    22492249            checkSyntax(globalObject->vm(), makeSource(source, interpreterName), error);
    2250             if (!line[0])
     2250            if (!line[0]) {
     2251                free(line);
    22512252                break;
     2253            }
    22522254            add_history(line);
     2255            free(line);
    22532256        } while (error.syntaxErrorType() == ParserError::SyntaxErrorRecoverable);
    22542257       
Note: See TracChangeset for help on using the changeset viewer.