Bug 163958 - jsc.cpp is leaking memory allocated by readline in runInteractive
Summary: jsc.cpp is leaking memory allocated by readline in runInteractive
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-25 11:15 PDT by Christopher Reid
Modified: 2016-10-25 13:36 PDT (History)
5 users (show)

See Also:


Attachments
patch (1.41 KB, patch)
2016-10-25 11:22 PDT, Christopher Reid
mark.lam: review+
Details | Formatted Diff | Diff
Updated changelog (1.61 KB, patch)
2016-10-25 11:40 PDT, Christopher Reid
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Reid 2016-10-25 11:15:05 PDT
runInteractive in jsc.cpp is currently leaking memory allocated by readline. According to man readline, the string returned is allocated by malloc and has to be deallocated. There isn't any deallocation being done right now.
Comment 1 Christopher Reid 2016-10-25 11:22:14 PDT
Created attachment 292791 [details]
patch
Comment 2 Mark Lam 2016-10-25 11:30:47 PDT
Comment on attachment 292791 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=292791&action=review

r=me with comment.

> Source/JavaScriptCore/ChangeLog:6
> +        The memory allocated by readline is not being freed when it should.

Please quote the spec above this line.  For example:

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."
Comment 3 Christopher Reid 2016-10-25 11:40:03 PDT
Created attachment 292793 [details]
Updated changelog

Thanks, I have updated the changelog accordingly
Comment 4 Mark Lam 2016-10-25 13:29:43 PDT
Comment on attachment 292793 [details]
Updated changelog

r=me again.
Comment 5 WebKit Commit Bot 2016-10-25 13:36:36 PDT
Comment on attachment 292793 [details]
Updated changelog

Clearing flags on attachment: 292793

Committed r207842: <http://trac.webkit.org/changeset/207842>
Comment 6 WebKit Commit Bot 2016-10-25 13:36:39 PDT
All reviewed patches have been landed.  Closing bug.