fix another Coverity bug.

This commit is contained in:
Matthias Clasen
2006-04-16 04:45:02 +00:00
parent fb700e81e3
commit 2f24913cb5
3 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2006-04-16 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextbuffer.c (_gtk_text_buffer_remove_all_tags):
Avoid a NULL dereference. (Coverity)
2006-04-15 Matthias Clasen <mclasen@redhat.com> 2006-04-15 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkrecentmanager.c: Make filename_warning() static, * gtk/gtkrecentmanager.c: Make filename_warning() static,

View File

@ -1,3 +1,8 @@
2006-04-16 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextbuffer.c (_gtk_text_buffer_remove_all_tags):
Avoid a NULL dereference. (Coverity)
2006-04-15 Matthias Clasen <mclasen@redhat.com> 2006-04-15 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkrecentmanager.c: Make filename_warning() static, * gtk/gtkrecentmanager.c: Make filename_warning() static,

View File

@ -2514,7 +2514,7 @@ gtk_text_buffer_remove_all_tags (GtkTextBuffer *buffer,
GtkTextIter first, second, tmp; GtkTextIter first, second, tmp;
GSList *tags; GSList *tags;
GSList *tmp_list; GSList *tmp_list;
GSList *prev; GSList *prev, *next;
GtkTextTag *tag; GtkTextTag *tag;
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer)); g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
@ -2569,14 +2569,15 @@ gtk_text_buffer_remove_all_tags (GtkTextBuffer *buffer,
if (tag == tmp_list->data) if (tag == tmp_list->data)
{ {
/* duplicate */ /* duplicate */
next = tmp_list->next;
if (prev) if (prev)
prev->next = tmp_list->next; prev->next = next;
tmp_list->next = NULL; tmp_list->next = NULL;
g_slist_free (tmp_list); g_slist_free (tmp_list);
tmp_list = prev->next; tmp_list = next;
/* prev is unchanged */ /* prev is unchanged */
} }
else else