2011-03-11 Michael Snyder <msnyder@vmware.com>
authorMichael Snyder <msnyder@vmware.com>
Fri, 11 Mar 2011 22:31:44 +0000 (22:31 +0000)
committerMichael Snyder <msnyder@vmware.com>
Fri, 11 Mar 2011 22:31:44 +0000 (22:31 +0000)
* event-loop-c (delete_async_signal_handler): Assert prev_ptr.
(delete_async_event_handler): Ditto.

gdb/ChangeLog
gdb/event-loop.c

index 898ff019aeb2b9de16eb94245d37fc57459430c1..5b76bee7d2048c97686b5afbb40d422a5a886354 100644 (file)
@@ -1,5 +1,8 @@
 2011-03-11  Michael Snyder  <msnyder@vmware.com>
 
+       * event-loop-c (delete_async_signal_handler): Assert prev_ptr.
+       (delete_async_event_handler): Ditto.
+
        * python/py-breakpoint.c (bppy_set_condition): Stop memory leak.
 
        * python/py-breakpoint.c (bppy_get_commands): Fix memory leak.
index 7f81bb30062655702c6c5aa0c5c8d7f3a08540cb..617835feb05942def7dc9964353a3fc885545033 100644 (file)
@@ -1077,6 +1077,7 @@ delete_async_signal_handler (async_signal_handler ** async_handler_ptr)
       prev_ptr = sighandler_list.first_handler;
       while (prev_ptr && prev_ptr->next_handler != (*async_handler_ptr))
        prev_ptr = prev_ptr->next_handler;
+      gdb_assert (prev_ptr);
       prev_ptr->next_handler = (*async_handler_ptr)->next_handler;
       if (sighandler_list.last_handler == (*async_handler_ptr))
        sighandler_list.last_handler = prev_ptr;
@@ -1185,6 +1186,7 @@ delete_async_event_handler (async_event_handler **async_handler_ptr)
       prev_ptr = async_event_handler_list.first_handler;
       while (prev_ptr && prev_ptr->next_handler != *async_handler_ptr)
        prev_ptr = prev_ptr->next_handler;
+      gdb_assert (prev_ptr);
       prev_ptr->next_handler = (*async_handler_ptr)->next_handler;
       if (async_event_handler_list.last_handler == (*async_handler_ptr))
        async_event_handler_list.last_handler = prev_ptr;