Bug 33770

Summary: dataFunctionMatrix leaks the array allocated by toArray
Product: WebKit Reporter: Mark Rowe (bdash) <mrowe>
Component: WebGLAssignee: Mark Rowe (bdash) <mrowe>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarrin, kbr, mrowe, webkit.review.bot
Priority: P2 Keywords: InRadar, Regression
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.6   
URL: http://build.webkit.org/results/SnowLeopard%20Intel%20Leaks/r53371%20(3490)/DumpRenderTree-leaks.txt
Attachments:
Description Flags
Patch oliver: review+

Mark Rowe (bdash)
Reported 2010-01-17 03:02:29 PST
The call to toArray allocates an array and transfers ownership to the caller. The array is not freed. The interface of toArray seems quite error-prone. Even internally the implementation of toArray looks like it will leak memory when error conditions are hit. It shouldn’t be working with raw pointers that have to be explicitly freed. A Vector<T> seems like a reasonable fit for this sort of data. If it’s not a good fit for some reason, then we have OwnPtr / PassOwnPtr to manage the lifetime of manually-allocated memory.
Attachments
Patch (7.74 KB, patch)
2010-01-19 16:15 PST, Mark Rowe (bdash)
oliver: review+
Mark Rowe (bdash)
Comment 1 2010-01-18 23:32:04 PST
Mark Rowe (bdash)
Comment 2 2010-01-19 16:15:55 PST
WebKit Review Bot
Comment 3 2010-01-19 16:22:20 PST
Attachment 46958 [details] did not pass style-queue: Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1 WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp:593: A case label should not be indented, but line up with its switch statement. [whitespace/indent] [4] WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp:641: A case label should not be indented, but line up with its switch statement. [whitespace/indent] [4] WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp:687: A case label should not be indented, but line up with its switch statement. [whitespace/indent] [4] Total errors found: 3 If any of these errors are false positives, please file a bug against check-webkit-style.
Mark Rowe (bdash)
Comment 4 2010-01-19 16:24:08 PST
(In reply to comment #3) > Attachment 46958 [details] did not pass style-queue: > > Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1 > WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp:593: A case label should > not be indented, but line up with its switch statement. [whitespace/indent] > [4] > WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp:641: A case label should > not be indented, but line up with its switch statement. [whitespace/indent] > [4] > WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp:687: A case label should > not be indented, but line up with its switch statement. [whitespace/indent] > [4] > Total errors found: 3 > > > If any of these errors are false positives, please file a bug against > check-webkit-style. I'm not fixing any of these. This code already did a terrible job of matching the style guidelines and fixing it all would result in it being impossible to see the substance of the change.
Oliver Hunt
Comment 5 2010-01-19 16:26:59 PST
Comment on attachment 46958 [details] Patch r=me
Mark Rowe (bdash)
Comment 6 2010-01-19 16:59:13 PST
Landed in r53509.
Note You need to log in before you can comment on or make changes to this bug.