diff packet.c @ 70:b0316ce64e4b

Merging in the changes from 0.41-0.43 main Dropbear tree
author Matt Johnston <matt@ucc.asn.au>
date Thu, 12 Aug 2004 16:41:58 +0000
parents f789045062e6
children 0cfba3034be5
line wrap: on
line diff
--- a/packet.c	Thu Aug 12 15:41:36 2004 +0000
+++ b/packet.c	Thu Aug 12 16:41:58 2004 +0000
@@ -50,7 +50,7 @@
 void write_packet() {
 
 	int len, written;
-	buffer * writebuf;
+	buffer * writebuf = NULL;
 	
 	TRACE(("enter write_packet"));
 	assert(!isempty(&ses.writequeue));
@@ -80,6 +80,7 @@
 		/* We've finished with the packet, free it */
 		dequeue(&ses.writequeue);
 		buf_free(writebuf);
+		writebuf = NULL;
 	} else {
 		/* More packet left to write, leave it in the queue for later */
 		buf_incrpos(writebuf, written);
@@ -503,6 +504,7 @@
 
 	/* clearwritebuf is finished with */
 	buf_free(clearwritebuf);
+	clearwritebuf = NULL;
 
 	/* enqueue the packet for sending */
 	buf_setpos(writebuf, 0);