Commit 35b0f0eb authored by mrowe@apple.com's avatar mrowe@apple.com
Browse files

Fix a leak of a CFStringRef reported by the build bot.

Reviewed by Jon Honeycutt.

* Plugins/WebBaseNetscapePluginView.mm:
(-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): Use a autoreleased
NSString rather than manually releasing a CFStringRef when we're done with it.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d13a3b64
2008-10-15 Mark Rowe <mrowe@apple.com>
Reviewed by Jon Honeycutt.
Fix a leak of a CFStringRef reported by the build bot.
* Plugins/WebBaseNetscapePluginView.mm:
(-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): Use a autoreleased
NSString rather than manually releasing a CFStringRef when we're done with it.
2008-10-15 Kenneth Russell <kenneth.russell@sun.com>
Reviewed and landed by Anders Carlsson.
......
......@@ -2138,7 +2138,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
NSString *target = nil;
if (cTarget) {
// Find the frame given the target string.
target = (NSString *)CFStringCreateWithCString(kCFAllocatorDefault, cTarget, kCFStringEncodingWindowsLatin1);
target = [NSString stringWithCString:cTarget encoding:NSISOLatin1StringEncoding];
}
WebFrame *frame = [self webFrame];
......@@ -2146,8 +2146,6 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
// displayed unless the loads are in the same frame as the plugin.
if ([[self dataSource] _documentLoader] != core([self webFrame])->loader()->activeDocumentLoader() &&
(!cTarget || [frame findFrameNamed:target] != frame)) {
if (target)
CFRelease(target);
return NPERR_GENERIC_ERROR;
}
......@@ -2170,9 +2168,8 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
// Make when targetting a frame or evaluating a JS string, perform the request after a delay because we don't
// want to potentially kill the plug-in inside of its URL request.
if (JSString != nil && target != nil && [frame findFrameNamed:target] != frame) {
if (JSString && target && [frame findFrameNamed:target] != frame) {
// For security reasons, only allow JS requests to be made on the frame that contains the plug-in.
CFRelease(target);
return NPERR_INVALID_PARAM;
}
......@@ -2187,8 +2184,6 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
didStartFromUserGesture:currentEventIsUserGesture];
[self performSelector:@selector(loadPluginRequest:) withObject:pluginRequest afterDelay:0];
[pluginRequest release];
if (target)
CFRelease(target);
} else {
WebBaseNetscapePluginStream *stream = [[WebBaseNetscapePluginStream alloc] initWithRequest:request
plugin:plugin
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment