WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
176268
Web Automation: -[_WKAutomationSession init] leaks
https://bugs.webkit.org/show_bug.cgi?id=176268
Summary
Web Automation: -[_WKAutomationSession init] leaks
Joseph Pecoraro
Reported
2017-09-01 21:06:51 PDT
Web Automation: -[_WKAutomationSession init] leaks:
> - (instancetype)init > { > return [self initWithConfiguration:[_WKAutomationSessionConfiguration new]]; > }
because we are not in ARC, the -new is a +1 but we should be passing an autoreleased object here. This was caught by the static analyzer. Test:
> // shell> xcrun clang -framework Foundation -framework WebKit leak.m > > #import <WebKit/WebKit.h> > @interface _WKAutomationSession : NSObject > @end > > static void leak() { > [[[_WKAutomationSession alloc] init] release]; > } > > int main() { > @autoreleasepool { leak(); } > sleep(1000); > return 0; > }
Leak: Process 68184: 1 leak for 16 total leaked bytes. Leak: 0x7fdd1b506ff0 size=16 zone: DefaultMallocZone_0x112fbd000 _WKAutomationSessionConfiguration ObjC WebKit 0x0eb156d9 0x001d8001 0x00000001 0x00000000 .V.............. Call stack: [thread 0x7fffa41cc340]: | 0x1 | start | main | leak | -[_WKAutomationSession init] _WKAutomationSession.mm:46 | +[NSObject new] | class_createInstance | calloc | malloc_zone_calloc
Attachments
[PATCH] Proposed Fix
(1.26 KB, patch)
2017-09-01 21:19 PDT
,
Joseph Pecoraro
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Joseph Pecoraro
Comment 1
2017-09-01 21:19:59 PDT
Created
attachment 319689
[details]
[PATCH] Proposed Fix
WebKit Commit Bot
Comment 2
2017-09-02 11:29:43 PDT
Comment on
attachment 319689
[details]
[PATCH] Proposed Fix Clearing flags on attachment: 319689 Committed
r221538
: <
http://trac.webkit.org/changeset/221538
>
WebKit Commit Bot
Comment 3
2017-09-02 11:29:45 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 4
2017-09-27 12:39:34 PDT
<
rdar://problem/34693703
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug