free(tmp);
sfree(tmp);
void try_send(Socket s) {    while (s->head) {	int nsent;	DWORD err;        int len, urgentflag;        if (s->sending_oob) {            urgentflag = MSG_OOB;            len = s->sending_oob;        } else {            urgentflag = 0;            len = s->head->buflen - s->head->bufpos;        }	nsent = send(s->s, s->head->buf + s->head->bufpos, len, urgentflag);        noise_ultralight(nsent);	if (nsent <= 0) {	    err = (nsent < 0 ? WSAGetLastError() : 0);	    if (err == WSAEWOULDBLOCK) {		/* Perfectly normal: we've sent all we can for the moment. */		s->writable = FALSE;                return;	    } else if (nsent == 0 ||		       err == WSAECONNABORTED ||		       err == WSAECONNRESET) {                /*                 * FIXME. This will have to be done better when we                 * start managing multiple sockets (e.g. SSH port                 * forwarding), because if we get CONNRESET while                 * trying to write a particular forwarded socket                 * then it isn't necessarily the end of the world.                 * Ideally I'd like to pass the error code back to                 * somewhere the next select_result() will see it,                 * but that might be hard. Perhaps I should pass it                 * back to be queued in the Windows front end bit.                 */                fatalbox(winsock_error_string(err));	    } else {		fatalbox(winsock_error_string(err));	    }	} else {	    s->head->bufpos += nsent;            if (s->sending_oob)                s->sending_oob -= nsent;	    if (s->head->bufpos >= s->head->buflen) {		struct buffer *tmp = s->head;		s->head = tmp->next;		free(tmp);		if (!s->head)		    s->tail = NULL;	    }	}    }}