[gconf] Avoid a crash when gconftool-2 can't read the db
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gconf] Avoid a crash when gconftool-2 can't read the db
- Date: Fri, 19 Feb 2010 23:29:22 +0000 (UTC)
commit 4e0bbe71059d5eeca65aabe25b803622fd6c4d78
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Feb 19 18:29:07 2010 -0500
Avoid a crash when gconftool-2 can't read the db
gconf/gconf.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/gconf/gconf.c b/gconf/gconf.c
index 964d096..4261524 100644
--- a/gconf/gconf.c
+++ b/gconf/gconf.c
@@ -511,6 +511,7 @@ gconf_engine_get_local (const gchar* address,
{
GConfEngine* conf;
GConfSource* source;
+ GConfSources* sources;
g_return_val_if_fail(address != NULL, NULL);
g_return_val_if_fail(err == NULL || *err == NULL, NULL);
@@ -519,10 +520,14 @@ gconf_engine_get_local (const gchar* address,
if (source == NULL)
return NULL;
-
+
+ sources = gconf_sources_new_from_source(source);
+ if (sources == NULL)
+ return NULL;
+
conf = gconf_engine_blank(FALSE);
- conf->local_sources = gconf_sources_new_from_source(source);
+ conf->local_sources = sources;
g_assert (gconf_engine_is_local (conf));
@@ -534,13 +539,19 @@ gconf_engine_get_local_for_addresses (GSList *addresses,
GError **err)
{
GConfEngine *conf;
+ GConfSources* sources;
g_return_val_if_fail (addresses != NULL, NULL);
g_return_val_if_fail (err == NULL || *err == NULL, NULL);
+ sources = gconf_sources_new_from_addresses (addresses, err);
+
+ if (sources == NULL)
+ return NULL;
+
conf = gconf_engine_blank (FALSE);
- conf->local_sources = gconf_sources_new_from_addresses (addresses, err);
+ conf->local_sources = sources;
g_assert (gconf_engine_is_local (conf));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]