]> Pileus Git - ~andy/gtk/commitdiff
Reorganize to avoid a possible NULL dereference. (Coverity)
authorMatthias Clasen <mclasen@redhat.com>
Wed, 12 Apr 2006 21:22:42 +0000 (21:22 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 12 Apr 2006 21:22:42 +0000 (21:22 +0000)
2006-04-12  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtknotebook.c (gtk_notebook_page_allocate): Reorganize
        to avoid a possible NULL dereference.  (Coverity)

ChangeLog
ChangeLog.pre-2-10
gtk/gtknotebook.c

index 82b35ca6112a1ef7f7df52139503165887ad5192..b6bb7f0a12396b448b943e068e798e1ebd6b0062 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-04-12  Matthias Clasen  <mclasen@redhat.com>
 
+        * gtk/gtknotebook.c (gtk_notebook_page_allocate): Reorganize
+        to avoid a possible NULL dereference.  (Coverity)
+
        * gdk/x11/gdkimage-x11.c (gdk_image_new_bitmap): Handle
        closed displays correctly.  (Coverity)
 
index 82b35ca6112a1ef7f7df52139503165887ad5192..b6bb7f0a12396b448b943e068e798e1ebd6b0062 100644 (file)
@@ -1,5 +1,8 @@
 2006-04-12  Matthias Clasen  <mclasen@redhat.com>
 
+        * gtk/gtknotebook.c (gtk_notebook_page_allocate): Reorganize
+        to avoid a possible NULL dereference.  (Coverity)
+
        * gdk/x11/gdkimage-x11.c (gdk_image_new_bitmap): Handle
        closed displays correctly.  (Coverity)
 
index c08db07bca86bb19969ebb8e80ff1cf76e047999..e7121d63422c5c11961d9dbf4bdfb591f231b723 100644 (file)
@@ -5134,16 +5134,9 @@ gtk_notebook_page_allocate (GtkNotebook     *notebook,
   gint tab_curvature;
   gint tab_pos = get_effective_tab_pos (notebook);
 
-  gtk_widget_style_get (widget,
-                       "focus-line-width", &focus_width,
-                       "tab-curvature", &tab_curvature,
-                       NULL);
-  
   xthickness = widget->style->xthickness;
   ythickness = widget->style->ythickness;
 
-  gtk_widget_get_child_requisition (page->tab_label, &tab_requisition);
-
   if (notebook->cur_page != page)
     {
       switch (tab_pos)
@@ -5161,6 +5154,15 @@ gtk_notebook_page_allocate (GtkNotebook     *notebook,
        }
     }
 
+  if (!page->tab_label)
+    return;
+
+  gtk_widget_get_child_requisition (page->tab_label, &tab_requisition);
+  gtk_widget_style_get (widget,
+                       "focus-line-width", &focus_width,
+                       "tab-curvature", &tab_curvature,
+                       NULL);
+
   switch (tab_pos)
     {
     case GTK_POS_TOP:
@@ -5212,8 +5214,7 @@ gtk_notebook_page_allocate (GtkNotebook     *notebook,
       break;
     }
 
-  if (page->tab_label)
-    gtk_widget_size_allocate (page->tab_label, &child_allocation);
+  gtk_widget_size_allocate (page->tab_label, &child_allocation);
 }
 
 static void