SSH2_MSG_GLOBAL_REQUEST,
packet, pos, "cleanup after"
" downstream went away");
+ sfree(packet);
share_remove_forwarding(cs, fwd);
i--; /* don't accidentally skip one as a result */
!ssh_agent_forwarding_permitted(cs->parent->ssh)) {
unsigned server_id = GET_32BIT(pkt);
unsigned char recipient_id[4];
+
+ sfree(request_name);
+
chan = share_find_channel_by_server(cs, server_id);
if (chan) {
PUT_32BIT(recipient_id, chan->downstream_id);
int auth_proto, protolen, datalen;
int pos;
+ sfree(request_name);
+
chan = share_find_channel_by_server(cs, server_id);
if (!chan) {
char *buf = dupprintf("X11 forwarding request for "
want_reply = pkt[15] != 0;
single_connection = pkt[16] != 0;
auth_proto_str = getstring(pkt+17, pktlen-17);
+ auth_proto = x11_identify_auth_proto(auth_proto_str);
+ sfree(auth_proto_str);
pos = 17 + getstring_size(pkt+17, pktlen-17);
auth_data = getstring(pkt+pos, pktlen-pos);
pos += getstring_size(pkt+pos, pktlen-pos);
+
if (pktlen < pos+4) {
err = dupprintf("Truncated CHANNEL_REQUEST(\"x11\") packet");
+ sfree(auth_data);
goto confused;
}
screen = GET_32BIT(pkt+pos);
- auth_proto = x11_identify_auth_proto(auth_proto_str);
if (auth_proto < 0) {
/* Reject due to not understanding downstream's
* requested authorisation method. */
chan->x11_auth_proto = auth_proto;
chan->x11_auth_data = x11_dehexify(auth_data,
&chan->x11_auth_datalen);
+ sfree(auth_data);
chan->x11_auth_upstream =
ssh_sharing_add_x11_display(cs->parent->ssh, auth_proto,
cs, chan);
break;
}
+
+ sfree(request_name);
}
ssh_send_packet_from_downstream(cs->parent->ssh, cs->id,
sharestate->connections = newtree234(share_connstate_cmp);
sharestate->ssh = ssh;
sharestate->server_verstring = NULL;
- sharestate->sockname = dupstr(sockname);
+ sharestate->sockname = sockname;
sharestate->nextid = 1;
return NULL;
}