Bug 163958

Summary: jsc.cpp is leaking memory allocated by readline in runInteractive
Product: WebKit Reporter: Christopher Reid <chris.reid>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, keith_miller, mark.lam, msaboff, saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
mark.lam: review+
Updated changelog none

Christopher Reid
Reported 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.
Attachments
patch (1.41 KB, patch)
2016-10-25 11:22 PDT, Christopher Reid
mark.lam: review+
Updated changelog (1.61 KB, patch)
2016-10-25 11:40 PDT, Christopher Reid
no flags
Christopher Reid
Comment 1 2016-10-25 11:22:14 PDT
Mark Lam
Comment 2 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."
Christopher Reid
Comment 3 2016-10-25 11:40:03 PDT
Created attachment 292793 [details] Updated changelog Thanks, I have updated the changelog accordingly
Mark Lam
Comment 4 2016-10-25 13:29:43 PDT
Comment on attachment 292793 [details] Updated changelog r=me again.
WebKit Commit Bot
Comment 5 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>
WebKit Commit Bot
Comment 6 2016-10-25 13:36:39 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.