summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2005-06-11 02:28:04 +0000
committerRyan Lortie <ryanl@src.gnome.org>2005-06-11 02:28:04 +0000
commite003ba87d14cee3b078e06374aa45cf6287f1e41 (patch)
tree96a771e4e23f27923108c6c22c975727133e4823
parent064a86e6203d21ed82a80da37e48925269317d60 (diff)
downloadmetacity-e003ba87d14cee3b078e06374aa45cf6287f1e41.tar.gz
Prevent using the address of a local variable as a hash key. (Bug #307209)
2005-06-10 Ryan Lortie <desrt@desrt.ca> * src/frames.c: Prevent using the address of a local variable as a hash key. (Bug #307209) * src/xprops.c (meta_prop_get_values): Fix a small leak in the case of a SYNC_COUNTER property value and HAVE_XSYNC not defined. (Bug #307214)
-rw-r--r--ChangeLog9
-rw-r--r--src/frames.c10
-rw-r--r--src/xprops.c7
3 files changed, 20 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index dc2c9f93..dfbc98b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-06-10 Ryan Lortie <desrt@desrt.ca>
+
+ * src/frames.c: Prevent using the address of a local variable
+ as a hash key. (Bug #307209)
+
+ * src/xprops.c (meta_prop_get_values): Fix a small leak in the
+ case of a SYNC_COUNTER property value and HAVE_XSYNC not
+ defined. (Bug #307214)
+
2005-06-07 Ray Strode <rstrode@redhat.com>
Cleanup font data when done with it (bug 306720).
diff --git a/src/frames.c b/src/frames.c
index e37e48fa..6c463902 100644
--- a/src/frames.c
+++ b/src/frames.c
@@ -188,7 +188,7 @@ meta_frames_init (MetaFrames *frames)
{
GTK_WINDOW (frames)->type = GTK_WINDOW_POPUP;
- frames->text_heights = g_hash_table_new (g_int_hash, g_int_equal);
+ frames->text_heights = g_hash_table_new (NULL, NULL);
frames->frames = g_hash_table_new (unsigned_long_hash, unsigned_long_equal);
@@ -296,7 +296,7 @@ meta_frames_font_changed (MetaFrames *frames)
if (g_hash_table_size (frames->text_heights) > 0)
{
g_hash_table_destroy (frames->text_heights);
- frames->text_heights = g_hash_table_new (g_int_hash, g_int_equal);
+ frames->text_heights = g_hash_table_new (NULL, NULL);
}
/* Queue a draw/resize on all frames */
@@ -395,9 +395,9 @@ meta_frames_ensure_layout (MetaFrames *frames,
meta_prefs_get_titlebar_font ());
size = pango_font_description_get_size (font_desc);
-
+
if (g_hash_table_lookup_extended (frames->text_heights,
- &size,
+ GINT_TO_POINTER (size),
&key, &value))
{
frame->text_height = GPOINTER_TO_INT (value);
@@ -409,7 +409,7 @@ meta_frames_ensure_layout (MetaFrames *frames,
gtk_widget_get_pango_context (widget));
g_hash_table_replace (frames->text_heights,
- &size,
+ GINT_TO_POINTER (size),
GINT_TO_POINTER (frame->text_height));
}
diff --git a/src/xprops.c b/src/xprops.c
index 155424a4..e5465b9b 100644
--- a/src/xprops.c
+++ b/src/xprops.c
@@ -1143,10 +1143,15 @@ meta_prop_get_values (MetaDisplay *display,
values[i].type = META_PROP_VALUE_INVALID;
#else
values[i].type = META_PROP_VALUE_INVALID;
+ if (results.prop)
+ {
+ XFree (results.prop);
+ results.prop = NULL;
+ }
#endif
break;
}
-
+
next:
++i;
}