box: Initialize size arrays to 0
authorTimm Bäder <mail@baedert.org>
Thu, 30 Mar 2017 07:02:00 +0000 (07:02 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 8 May 2017 22:03:26 +0000 (18:03 -0400)
Thats the right thing to do.

https://bugzilla.gnome.org/show_bug.cgi?id=773814

gtk/gtkbox.c

index e034be851b9689c3cbd8a0b90662e0e7823fbe70..1e9f18d5bd883633741aae87b444de28a2d853f2 100644 (file)
@@ -521,6 +521,7 @@ gtk_box_size_allocate_no_center (GtkWidget           *widget,
 
   direction = gtk_widget_get_direction (widget);
   sizes = g_newa (GtkRequestedSize, nvis_children);
+  memset (sizes, 0, nvis_children * sizeof (GtkRequestedSize));
 
   if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
     size = allocation->width - (nvis_children - 1) * private->spacing;
@@ -1220,7 +1221,7 @@ gtk_box_size_allocate (GtkWidget     *widget,
                            allocation,
                            gtk_widget_get_allocated_baseline (widget),
                            &clip);
-  
+
   gtk_widget_set_clip (widget, &clip);
 }
 
@@ -1763,6 +1764,7 @@ gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
     return;
 
   sizes = g_newa (GtkRequestedSize, nvis_children);
+  memset (sizes, 0, nvis_children * sizeof (GtkRequestedSize));
   size = avail_size - (nvis_children - 1) * private->spacing;
 
   /* Retrieve desired size for visible children */