Zero out some stack-allocated X structures, to avoid valgrind warnings

2006-08-15  Matthias Clasen  <mclasen@redhat.com>

        * gdk/x11/gdkdnd-x11.c (gdk_window_register_dnd):
        * gdk/x11/gdkwindow-x11.c (gdk_window_set_decorations):
        (gdk_window_set_functions): Zero out some stack-allocated
        X structures, to avoid valgrind warnings about uninitialized
        memory.  (#349382, David Baron)
This commit is contained in:
Matthias Clasen 2006-08-15 05:46:08 +00:00 committed by Matthias Clasen
parent e4f6c9d4d0
commit bb279057f3
4 changed files with 22 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2006-08-15 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkdnd-x11.c (gdk_window_register_dnd):
* gdk/x11/gdkwindow-x11.c (gdk_window_set_decorations):
(gdk_window_set_functions): Zero out some stack-allocated
X structures, to avoid valgrind warnings about uninitialized
memory. (#349382, David Baron)
2006-08-14 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentchooser.c:

View File

@ -1,3 +1,11 @@
2006-08-15 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkdnd-x11.c (gdk_window_register_dnd):
* gdk/x11/gdkwindow-x11.c (gdk_window_set_decorations):
(gdk_window_set_functions): Zero out some stack-allocated
X structures, to avoid valgrind warnings about uninitialized
memory. (#349382, David Baron)
2006-08-14 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentchooser.c:

View File

@ -3754,6 +3754,8 @@ gdk_window_register_dnd (GdkWindow *window)
motif_drag_receiver_info_atom = gdk_x11_get_xatom_by_name_for_display (display,
"_MOTIF_DRAG_RECEIVER_INFO");
/* initialize to zero to avoid writing uninitialized data to socket */
memset(&info, 0, sizeof(info));
info.byte_order = local_byte_order;
info.protocol_version = 0;
info.protocol_style = XmDRAG_DYNAMIC;

View File

@ -5021,6 +5021,8 @@ gdk_window_set_decorations (GdkWindow *window,
g_return_if_fail (GDK_IS_WINDOW (window));
/* initialize to zero to avoid writing uninitialized data to socket */
memset(&hints, 0, sizeof(hints));
hints.flags = MWM_HINTS_DECORATIONS;
hints.decorations = decorations;
@ -5089,6 +5091,8 @@ gdk_window_set_functions (GdkWindow *window,
g_return_if_fail (GDK_IS_WINDOW (window));
/* initialize to zero to avoid writing uninitialized data to socket */
memset(&hints, 0, sizeof(hints));
hints.flags = MWM_HINTS_FUNCTIONS;
hints.functions = functions;