[gtk+] a11y: fix a typo leading to a crash



commit 347357738669c90236f7385b07925da20660a17a
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Jun 6 09:22:29 2012 -0400

    a11y: fix a typo leading to a crash
    
    text can't be NULL here, or we would have failed way earlier.
    The original code from gail returned if the renderer text was NULL, and
    we have to do that, or we'll end up calling e.g.
    g_utf8_offset_to_pointer() on a NULL pointer.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=827930
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677551

 gtk/a11y/gtktextcellaccessible.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/gtk/a11y/gtktextcellaccessible.c b/gtk/a11y/gtktextcellaccessible.c
index dbc9978..cf24b49 100644
--- a/gtk/a11y/gtktextcellaccessible.c
+++ b/gtk/a11y/gtktextcellaccessible.c
@@ -542,11 +542,8 @@ gtk_text_cell_accessible_get_character_extents (AtkText      *text,
   gtk_renderer = GTK_CELL_RENDERER_TEXT (gail_renderer->renderer);
 
   g_object_get (gtk_renderer, "text", &renderer_text, NULL);
-  if (text == NULL)
-    {
-      g_free (renderer_text);
-      return;
-    }
+  if (renderer_text == NULL)
+    return;
 
   parent = atk_object_get_parent (ATK_OBJECT (text));
   if (GTK_IS_CONTAINER_CELL_ACCESSIBLE (parent))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]