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
This commit is contained in:
Philip Withnall 2013-11-20 17:30:22 +00:00
parent 19222a6364
commit 61c46d911f

View File

@ -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));