diff --git a/src/ChangeLog b/src/ChangeLog index bdd5a3664..8d09a5022 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -24,6 +24,8 @@ * view.c (enqueue_change): Made the algorithm independent of the memory layout (especially the order) of the fields in struct hexedit_change_node. Rewrote it. + * view.c (free_change_list): Don't use view->change_list as + scratch variable. 2005-04-14 Roland Illig diff --git a/src/view.c b/src/view.c index cfecaed20..e6a1aafe8 100644 --- a/src/view.c +++ b/src/view.c @@ -439,13 +439,13 @@ view_handle_editkey (WView *view, int key) static void free_change_list (WView *view) { - struct hexedit_change_node *n = view->change_list; + struct hexedit_change_node *curr, *next; - while (n) { - view->change_list = n->next; - g_free (n); - n = view->change_list; + for (curr = view->change_list; curr != NULL; curr = next) { + next = curr->next; + g_free (curr); } + view->change_list = NULL; view->dirty++; }