Skip to content

Commit aced770

Browse files
lapcatrentzsch
authored andcommitted
Fix bugs identified by clang static analyzer.
Signed-off-by: Jonathan 'Wolf' Rentzsch <[email protected]>
1 parent 2aa30c6 commit aced770

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

Plugin/CTFMenubarMenuController.m

+1-3
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ - (id) init
125125
}
126126

127127
self = [ super init ];
128-
129-
sSingleton = self;
130128

131129
if( self ) {
132130
if( ! [ NSBundle loadNibNamed: @"MenubarMenu" owner: self ] )
@@ -187,7 +185,7 @@ - (void) awakeFromNib
187185
+ (CTFMenubarMenuController*) sharedController
188186
{
189187
if( !sSingleton )
190-
[ [ CTFMenubarMenuController alloc ] init ];
188+
sSingleton = [ [ CTFMenubarMenuController alloc ] init ];
191189

192190
return sSingleton;
193191
}

Plugin/Plugin.m

+2-4
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ - (id) initWithArguments:(NSDictionary *)arguments
8686
{
8787
self = [super init];
8888
if (self) {
89-
// get defaults
90-
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
91-
9289
self.webView = [[[arguments objectForKey:WebPlugInContainerKey] webFrame] webView];
9390

9491
self.container = [arguments objectForKey:WebPlugInContainingElementKey];
@@ -133,7 +130,7 @@ - (id) initWithArguments:(NSDictionary *)arguments
133130
#endif
134131

135132
_fromYouTube = [self.host isEqualToString:@"www.youtube.com"]
136-
|| [flashvars rangeOfString: @"www.youtube.com"].location != NSNotFound;
133+
|| ( flashvars != nil && [flashvars rangeOfString: @"www.youtube.com"].location != NSNotFound );
137134

138135
// Handle if this is loading from whitelist
139136

@@ -208,6 +205,7 @@ - (void) dealloc
208205
self.container = nil;
209206
self.host = nil;
210207
self.webView = nil;
208+
self.baseURL = nil;
211209

212210
[_flashVars release];
213211
[_badgeText release];

0 commit comments

Comments
 (0)