summaryrefslogtreecommitdiffstats
path: root/base/native_library_mac.mm
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-15 22:34:09 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-15 22:34:09 +0000
commitb7efd7696d85b8b74cb29a22821516f166011511 (patch)
treeb0fa4ffe09ea8c206f45f5d78e88fdcaf34c8074 /base/native_library_mac.mm
parent5a99bd194fea2c2128a962ccadb252e8eefea78b (diff)
downloadchromium_src-b7efd7696d85b8b74cb29a22821516f166011511.zip
chromium_src-b7efd7696d85b8b74cb29a22821516f166011511.tar.gz
chromium_src-b7efd7696d85b8b74cb29a22821516f166011511.tar.bz2
Fix a string leak in GetFunctionPointerFromNativeLibrary
BUG=none TEST=Mac WebKit valgrind Review URL: http://codereview.chromium.org/501031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34616 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/native_library_mac.mm')
-rw-r--r--base/native_library_mac.mm7
1 files changed, 4 insertions, 3 deletions
diff --git a/base/native_library_mac.mm b/base/native_library_mac.mm
index 577f5ac..63ac9df 100644
--- a/base/native_library_mac.mm
+++ b/base/native_library_mac.mm
@@ -55,11 +55,12 @@ void UnloadNativeLibrary(NativeLibrary library) {
// static
void* GetFunctionPointerFromNativeLibrary(NativeLibrary library,
const char* name) {
- if (library->type == BUNDLE)
- return CFBundleGetFunctionPointerForName(library->bundle,
+ if (library->type == BUNDLE) {
+ scoped_cftyperef<CFStringRef> symbol_name(
CFStringCreateWithCString(kCFAllocatorDefault, name,
kCFStringEncodingUTF8));
-
+ return CFBundleGetFunctionPointerForName(library->bundle, symbol_name);
+ }
return dlsym(library->dylib, name);
}