diff options
author | earthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-06 18:05:51 +0000 |
---|---|---|
committer | earthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-06 18:05:51 +0000 |
commit | 4bbb72df08948879f54f96b2103942a2c8041950 (patch) | |
tree | 9d1c16e189545bbbf0a4706dab8fbaa26be4ccb7 /net | |
parent | c88bf1a44813ad92a685b3d21a50384779ebace0 (diff) | |
download | chromium_src-4bbb72df08948879f54f96b2103942a2c8041950.zip chromium_src-4bbb72df08948879f54f96b2103942a2c8041950.tar.gz chromium_src-4bbb72df08948879f54f96b2103942a2c8041950.tar.bz2 |
Annotate a third-party leak in SettingGetterImplGSettings::LoadAndCheckVersion().
BUG=380782
R=rvargas@chromium.org
Review URL: https://codereview.chromium.org/316013006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/proxy/proxy_config_service_linux.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc index 0e65b72..6fbf3d5 100644 --- a/net/proxy/proxy_config_service_linux.cc +++ b/net/proxy/proxy_config_service_linux.cc @@ -28,6 +28,7 @@ #include "base/bind.h" #include "base/compiler_specific.h" +#include "base/debug/leak_annotations.h" #include "base/environment.h" #include "base/file_util.h" #include "base/files/file_path.h" @@ -204,6 +205,7 @@ bool ProxyConfigServiceLinux::Delegate::GetConfigFromEnv(ProxyConfig* config) { namespace { const int kDebounceTimeoutMilliseconds = 250; +const char kProxyGConfSchema[] = "org.gnome.system.proxy"; #if defined(USE_GCONF) // This setting getter uses gconf, as used in GNOME 2 and some GNOME 3 desktops. @@ -574,8 +576,8 @@ class SettingGetterImplGSettings DCHECK(!client_); DCHECK(!task_runner_.get()); - if (!SchemaExists("org.gnome.system.proxy") || - !(client_ = libgio_loader_.g_settings_new("org.gnome.system.proxy"))) { + if (!SchemaExists(kProxyGConfSchema) || + !(client_ = libgio_loader_.g_settings_new(kProxyGConfSchema))) { // It's not clear whether/when this can return NULL. LOG(ERROR) << "Unable to create a gsettings client"; return false; @@ -815,9 +817,12 @@ bool SettingGetterImplGSettings::LoadAndCheckVersion( } } - GSettings* client; - if (!SchemaExists("org.gnome.system.proxy") || - !(client = libgio_loader_.g_settings_new("org.gnome.system.proxy"))) { + GSettings* client = NULL; + if (SchemaExists(kProxyGConfSchema)) { + ANNOTATE_SCOPED_MEMORY_LEAK; // http://crbug.com/380782 + client = libgio_loader_.g_settings_new(kProxyGConfSchema); + } + if (!client) { VLOG(1) << "Cannot create gsettings client. Will fall back to gconf."; return false; } |