mirror of
https://github.com/openssh/libopenssh
synced 2026-04-16 01:35:52 +00:00
free the internal state in ssh_packet_close()
This commit is contained in:
10
ssh/packet.c
10
ssh/packet.c
@@ -550,7 +550,7 @@ ssh_packet_close(struct ssh *ssh)
|
||||
kex_free_newkeys(state->newkeys[mode]);
|
||||
if (state->compression_buffer) {
|
||||
sshbuf_free(state->compression_buffer);
|
||||
if (ssh->state->compression_out_started) {
|
||||
if (state->compression_out_started) {
|
||||
z_streamp stream = &state->compression_out_stream;
|
||||
debug("compress outgoing: "
|
||||
"raw data %llu, compressed %llu, factor %.2f",
|
||||
@@ -558,10 +558,10 @@ ssh_packet_close(struct ssh *ssh)
|
||||
(unsigned long long)stream->total_out,
|
||||
stream->total_in == 0 ? 0.0 :
|
||||
(double) stream->total_out / stream->total_in);
|
||||
if (ssh->state->compression_out_failures == 0)
|
||||
if (state->compression_out_failures == 0)
|
||||
deflateEnd(stream);
|
||||
}
|
||||
if (ssh->state->compression_in_started) {
|
||||
if (state->compression_in_started) {
|
||||
z_streamp stream = &state->compression_out_stream;
|
||||
debug("compress incoming: "
|
||||
"raw data %llu, compressed %llu, factor %.2f",
|
||||
@@ -569,7 +569,7 @@ ssh_packet_close(struct ssh *ssh)
|
||||
(unsigned long long)stream->total_in,
|
||||
stream->total_out == 0 ? 0.0 :
|
||||
(double) stream->total_in / stream->total_out);
|
||||
if (ssh->state->compression_in_failures == 0)
|
||||
if (state->compression_in_failures == 0)
|
||||
inflateEnd(stream);
|
||||
}
|
||||
}
|
||||
@@ -581,6 +581,8 @@ ssh_packet_close(struct ssh *ssh)
|
||||
free(ssh->remote_ipaddr);
|
||||
ssh->remote_ipaddr = NULL;
|
||||
}
|
||||
free(ssh->state);
|
||||
ssh->state = NULL;
|
||||
}
|
||||
|
||||
/* Sets remote side protocol flags. */
|
||||
|
||||
Reference in New Issue
Block a user