Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(565)

Unified Diff: net/http/http_auth_gssapi_posix.cc

Issue 2854004: Coverity: fix possible library leak in GSSAPISharedLibrary::LoadSharedLibrary. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_gssapi_posix.cc
diff --git a/net/http/http_auth_gssapi_posix.cc b/net/http/http_auth_gssapi_posix.cc
index 4ccdf404e163cf93e06f8f9a94decdeb84374fe4..6e41bdcffcb9055e108af2dc7f43b636b23c7263 100644
--- a/net/http/http_auth_gssapi_posix.cc
+++ b/net/http/http_auth_gssapi_posix.cc
@@ -80,9 +80,12 @@ base::NativeLibrary GSSAPISharedLibrary::LoadSharedLibrary() {
const char* library_name = kLibraryNames[i];
FilePath file_path(library_name);
base::NativeLibrary lib = base::LoadNativeLibrary(file_path);
- // Only return this library if we can bind the functions we need.
- if (lib && BindMethods(lib))
- return lib;
+ if (lib) {
+ // Only return this library if we can bind the functions we need.
+ if (BindMethods(lib))
+ return lib;
+ base::UnloadNativeLibrary(lib);
+ }
}
LOG(WARNING) << "Unable to find a compatible GSSAPI library";
return NULL;
@@ -511,4 +514,3 @@ int HttpAuthGSSAPI::GetNextSecurityToken(const std::wstring& spn,
}
} // namespace net
-
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698