Index: /common/trunk/MODS
===================================================================
--- /common/trunk/MODS (revision 474)
+++ /common/trunk/MODS (revision 475)
@@ -229,10 +229,10 @@
 	* 28 January 2000
 
-v1.1.1	- Add extra debugging code
+v1.1.1  - Add extra debugging code
 	* 1 February 2000
 
-v1.1.2	- Add routines for handling NTP format timestamps, in ntp.[ch]
+v1.1.2  - Add routines for handling NTP format timestamps, in ntp.[ch]
 	- Add udp_addr_valid.
-        - Fix cname setup for Win32.
+	- Fix cname setup for Win32.
 	- Add udp_init_if() call, to open a UDP/IP socket bound to a
 	  specific interface
@@ -244,12 +244,12 @@
 	* 14 February 2000
 
-v1.1.3	- Fix debug_set_core_dir() when not debugging.
+v1.1.3  - Fix debug_set_core_dir() when not debugging.
 	* 14 February 2000
 
-v1.1.4	- Add tests for mbus_parser.c/mbus_addr.c and fix bugs found
+v1.1.4  - Add tests for mbus_parser.c/mbus_addr.c and fix bugs found
 	- Fix use of free()'d memory in mbus.c
 	* 24 February 2000
 
-v1.1.5	- Remove SunOS and Solaris defines from the configure script, they
+v1.1.5  - Remove SunOS and Solaris defines from the configure script, they
 	  shouldn't be necessary any longer.
 	- Add workaround for missing getaddrinfo() on some platforms.
@@ -259,4 +259,5 @@
 	- Change RTP event type #defines into rtp_event_type so compiler can
 	  check all cases are covered in decision blocks.
+	- Fix waiting_ack next is set to null when message is put on ack list.
 
 Still to do...
Index: /common/trunk/src/mbus.c
===================================================================
--- /common/trunk/src/mbus.c (revision 474)
+++ /common/trunk/src/mbus.c (revision 475)
@@ -496,10 +496,10 @@
 }
 
-static void mbus_flush_msgs(struct mbus_msg *queue)
+static void mbus_flush_msgs(struct mbus_msg **queue)
 {
         struct mbus_msg *curr, *next;
         int i;
-
-        curr = queue;
+	
+        curr = *queue;
         while(curr) {
                 next = curr->next;
@@ -509,6 +509,8 @@
                         xfree(curr->arg_list[i]);
                 }
+		xfree(curr);
                 curr = next;
         }
+	*queue = NULL;
 }
 
@@ -525,6 +527,6 @@
 	/* FIXME: It should be a fatal error to call mbus_exit() if some messages are still outstanding. */
 	/*        We will need an mbus_flush() call first though, to ensure nothing is waiting.          */
-        mbus_flush_msgs(m->cmd_queue);
-        mbus_flush_msgs(m->waiting_ack);
+        mbus_flush_msgs(&m->cmd_queue);
+        mbus_flush_msgs(&m->waiting_ack);
 
         if (m->encrkey != NULL) {
@@ -602,4 +604,5 @@
 			gettimeofday(&(curr->send_time), NULL);
 			m->waiting_ack = curr;
+			curr->next = NULL;
 			return;
 		} else {
