diff options
author | Mark McLoughlin <mark@skynet.ie> | 2004-09-28 06:46:31 +0000 |
---|---|---|
committer | Mark McLoughlin <markmc@src.gnome.org> | 2004-09-28 06:46:31 +0000 |
commit | bb56e552f29eff1cc0d69defd4b8bcc7c553bb74 (patch) | |
tree | 56a0ef5dabca81406a899425ea168334edc977d3 | |
parent | 077890e95e6dc54d9476460f6b69385402f0f0cc (diff) | |
download | gconf-bb56e552f29eff1cc0d69defd4b8bcc7c553bb74.tar.gz |
Leak identified by Kjartan in bug #153891.
2004-09-28 Mark McLoughlin <mark@skynet.ie>
Leak identified by Kjartan in bug #153891.
* gconf/gconfd.c: (gconf_server_load_sources):
Plug leak.
* gconf/gconf-internals.c:
(gconf_load_source_path): remove some crufty code,
don't unneccessarily copy strings.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | gconf/gconf-internals.c | 17 | ||||
-rw-r--r-- | gconf/gconfd.c | 2 |
3 files changed, 17 insertions, 13 deletions
@@ -1,3 +1,14 @@ +2004-09-28 Mark McLoughlin <mark@skynet.ie> + + Leak identified by Kjartan in bug #153891. + + * gconf/gconfd.c: (gconf_server_load_sources): + Plug leak. + + * gconf/gconf-internals.c: + (gconf_load_source_path): remove some crufty code, + don't unneccessarily copy strings. + 2004-09-14 Mark McLoughlin <mark@skynet.ie> * configure.in: post-release bump to 2.8.1. diff --git a/gconf/gconf-internals.c b/gconf/gconf-internals.c index b7f3c1ba..24a461e1 100644 --- a/gconf/gconf-internals.c +++ b/gconf/gconf-internals.c @@ -827,7 +827,6 @@ gconf_load_source_path(const gchar* filename, GError** err) FILE* f; GSList *l = NULL; gchar buf[512]; - guint n; f = fopen(filename, "r"); @@ -885,9 +884,12 @@ gconf_load_source_path(const gchar* filename, GError** err) if (*varsubst != '\0') /* Drop lines with just two quote marks or something */ { gconf_log(GCL_DEBUG, _("Adding source `%s'\n"), varsubst); - l = g_slist_append (l, g_strdup(varsubst)); + l = g_slist_append (l, varsubst); } - g_free(varsubst); + else + { + g_free (varsubst); + } } } @@ -905,15 +907,6 @@ gconf_load_source_path(const gchar* filename, GError** err) fclose(f); - /* This will make sense if you realize that we reversed the list - as we loaded it, and are now reversing it to be correct again. - */ - - if (l == NULL) - return NULL; - - n = g_slist_length(l); - g_assert(n > 0); return l; } diff --git a/gconf/gconfd.c b/gconf/gconfd.c index ead6e970..212b24cf 100644 --- a/gconf/gconfd.c +++ b/gconf/gconfd.c @@ -369,7 +369,7 @@ gconf_server_load_sources(void) error = NULL; } - g_slist_free(addresses); + gconf_address_list_free(addresses); g_assert(sources != NULL); |