[gtk+] gtkentry: Return early from gtk_entry_clear() if no icon info exists



commit 61c46d911ff0840752bf8aa595d42da012d5d7b7
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Wed Nov 20 17:30:22 2013 +0000

    gtkentry: Return early from gtk_entry_clear() if no icon info exists
    
    This helps scan-build avoid some false positive potential NULL pointer
    dereference warnings.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=712760

 gtk/gtkentry.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index d3f2ab5..c0b9d43 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -7437,7 +7437,10 @@ gtk_entry_clear (GtkEntry             *entry,
   EntryIconInfo *icon_info = priv->icons[icon_pos];
   GtkImageType storage_type;
 
-  if (icon_info && _gtk_icon_helper_get_is_empty (icon_info->icon_helper))
+  if (icon_info == NULL)
+    return;
+
+  if (_gtk_icon_helper_get_is_empty (icon_info->icon_helper))
     return;
 
   g_object_freeze_notify (G_OBJECT (entry));


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