Index: utils.c =================================================================== RCS file: /cvs/src/src/gdb/utils.c,v retrieving revision 1.110 diff -u -p -r1.110 utils.c --- utils.c 21 Sep 2003 01:26:45 -0000 1.110 +++ utils.c 17 Dec 2003 20:35:56 -0000 @@ -316,11 +316,14 @@ do_my_cleanups (struct cleanup **pmy_cha struct cleanup *old_chain) { struct cleanup *ptr; - while ((ptr = *pmy_chain) != old_chain) + if (old_chain != NULL) { - *pmy_chain = ptr->next; /* Do this first incase recursion */ - (*ptr->function) (ptr->arg); - xfree (ptr); + while ((ptr = *pmy_chain) != old_chain) + { + *pmy_chain = ptr->next; /* Do this first incase recursion */ + (*ptr->function) (ptr->arg); + xfree (ptr); + } } }