From 4528eae1f3c34419df4b1c67c010396e96f3dd14 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Fri, 27 Feb 2004 00:52:45 +0000 Subject: [PATCH] Fix memory leak in case of mismatched property type. Thu Feb 26 19:48:39 2004 Owen Taylor * gdk/x11/xsettings-client.c (read_settings): Fix memory leak in case of mismatched property type. --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gdk/x11/xsettings-client.c | 8 ++++++-- 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 12ffe643cc..cc75a05cc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Feb 26 19:48:39 2004 Owen Taylor + + * gdk/x11/xsettings-client.c (read_settings): Fix memory leak + in case of mismatched property type. + Thu Feb 26 18:25:57 2004 Jonathan Blandford * gtk/gtkfilechooser.h (GtkFileChooserAction): Add two more folder diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 12ffe643cc..cc75a05cc1 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Thu Feb 26 19:48:39 2004 Owen Taylor + + * gdk/x11/xsettings-client.c (read_settings): Fix memory leak + in case of mismatched property type. + Thu Feb 26 18:25:57 2004 Jonathan Blandford * gtk/gtkfilechooser.h (GtkFileChooserAction): Add two more folder diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 12ffe643cc..cc75a05cc1 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Thu Feb 26 19:48:39 2004 Owen Taylor + + * gdk/x11/xsettings-client.c (read_settings): Fix memory leak + in case of mismatched property type. + Thu Feb 26 18:25:57 2004 Jonathan Blandford * gtk/gtkfilechooser.h (GtkFileChooserAction): Add two more folder diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 12ffe643cc..cc75a05cc1 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Thu Feb 26 19:48:39 2004 Owen Taylor + + * gdk/x11/xsettings-client.c (read_settings): Fix memory leak + in case of mismatched property type. + Thu Feb 26 18:25:57 2004 Jonathan Blandford * gtk/gtkfilechooser.h (GtkFileChooserAction): Add two more folder diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 12ffe643cc..cc75a05cc1 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Thu Feb 26 19:48:39 2004 Owen Taylor + + * gdk/x11/xsettings-client.c (read_settings): Fix memory leak + in case of mismatched property type. + Thu Feb 26 18:25:57 2004 Jonathan Blandford * gtk/gtkfilechooser.h (GtkFileChooserAction): Add two more folder diff --git a/gdk/x11/xsettings-client.c b/gdk/x11/xsettings-client.c index 891d477e76..8b81b45242 100644 --- a/gdk/x11/xsettings-client.c +++ b/gdk/x11/xsettings-client.c @@ -383,9 +383,13 @@ read_settings (XSettingsClient *client) &type, &format, &n_items, &bytes_after, &data); XSetErrorHandler (old_handler); - if (result == Success && type == client->xsettings_atom) + if (result == Success && type != None) { - if (format != 8) + if (type != client->xsettings_atom) + { + fprintf (stderr, "Invalid type for XSETTINGS property"); + } + eles if (format != 8) { fprintf (stderr, "Invalid format for XSETTINGS property %d", format); }