Bug 161597

Summary: [Mac] Address some clang static analyzer warnings in WebKit
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: WebKit Misc.Assignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: joepeck
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[PATCH] Proposed Fix
none
[PATCH] Proposed Fix darin: review+

Joseph Pecoraro
Reported 2016-09-05 00:51:11 PDT
Address some clang static analyzer warnings in WebKit
Attachments
[PATCH] Proposed Fix (7.77 KB, patch)
2016-09-05 00:55 PDT, Joseph Pecoraro
no flags
[PATCH] Proposed Fix (7.82 KB, patch)
2016-09-05 00:56 PDT, Joseph Pecoraro
darin: review+
Joseph Pecoraro
Comment 1 2016-09-05 00:55:13 PDT
Issues being addressed: AnalyzeShallow WebFullScreenController.mm In file included from Source/WebKit/mac/WebView/WebFullScreenController.mm:28: Source/WebKit/mac/WebView/WebFullScreenController.h:58:10: warning: Instance variable '_isPlaying' in class 'WebFullScreenController' is never used by the methods in its @implementation (although it may be used by category methods) AnalyzeShallow WebImmediateActionController.mm In file included from Source/WebKit/mac/WebView/WebImmediateActionController.mm:26: Source/WebKit/mac/WebView/WebImmediateActionController.h:54:10: warning: Instance variable '_isShowingTextIndicator' in class 'WebImmediateActionController' is never used by the methods in its @implementation (although it may be used by category methods) AnalyzeShallow WebSelectionServiceController.mm Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.mm:83:36: warning: Potential leak of an object stored into 'attachment' Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.mm:85:34: warning: Potential leak of an object stored into 'cell' AnalyzeShallow WebSharingServicePickerController.mm Source/WebKit/mac/Misc/WebSharingServicePickerController.mm:169:32: warning: Potential leak of an object stored into 'services' --- AnalyzeShallow WebVideoFullscreenManagerProxy.mm Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:60:12: warning: Potential leak of an object AnalyzeShallow WKDOMRange.mm Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:150:12: warning: Potential leak of an object AnalyzeShallow WKSharingServicePickerDelegate.mm Source/WebKit2/UIProcess/mac/WKSharingServicePickerDelegate.mm:77:32: warning: Potential leak of an object stored into 'services'
Joseph Pecoraro
Comment 2 2016-09-05 00:55:43 PDT
Created attachment 287937 [details] [PATCH] Proposed Fix
Joseph Pecoraro
Comment 3 2016-09-05 00:56:37 PDT
Created attachment 287938 [details] [PATCH] Proposed Fix
Darin Adler
Comment 4 2016-09-05 10:04:22 PDT
Comment on attachment 287938 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=287938&action=review > Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.mm:87 > + RetainPtr<NSMutableAttributedString> attributedStringWithRichContent = (NSMutableAttributedString *)[NSMutableAttributedString attributedStringWithAttachment:attachment.get()]; I suggest we not use a RetainPtr here. NSMutableAttributedString *attributedStringWithRichContent = [NSMutableAttributedString attributedStringWithAttachment:attachment.get()]; > Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.mm:90 > bool hasRichContentServices = hasCompatibleServicesForItems(@[ attributedStringWithRichContent.get() ]); I suggest we not use a local variable here.
Joseph Pecoraro
Comment 5 2016-09-08 00:21:15 PDT
Note You need to log in before you can comment on or make changes to this bug.