Bug 140889 - Plug leak in jsValueWithDictionaryInContext().
Summary: Plug leak in jsValueWithDictionaryInContext().
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-26 11:03 PST by Andreas Kling
Modified: 2015-01-26 12:57 PST (History)
2 users (show)

See Also:


Attachments
Patch (1.37 KB, patch)
2015-01-26 11:04 PST, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2015-01-26 11:03:51 PST
There's a JSStringRef leak below jsValueWithDictionaryInContext() according to leaks bot. Let's plug it.
Comment 1 Andreas Kling 2015-01-26 11:04:31 PST
Created attachment 245356 [details]
Patch
Comment 2 David Kilzer (:ddkilzer) 2015-01-26 11:36:44 PST
Comment on attachment 245356 [details]
Patch

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

> Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm:199
>          JSStringRef name = JSStringCreateWithCFString((CFStringRef)key);
>          JSObjectSetProperty([context JSGlobalContextRef], resultObject, name, [value JSValueRef], 0, &exception);
> +        JSStringRelease(name);

Can we annotate JSStringCreateWithCFString() and JSStringRelease() so the clang static analyzer will find these leaks for us?
Comment 3 WebKit Commit Bot 2015-01-26 12:57:38 PST
Comment on attachment 245356 [details]
Patch

Clearing flags on attachment: 245356

Committed r179137: <http://trac.webkit.org/changeset/179137>
Comment 4 WebKit Commit Bot 2015-01-26 12:57:42 PST
All reviewed patches have been landed.  Closing bug.