aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2017-04-21 10:54:38 +0200
committerAndreas Schneider <asn@cryptomilk.org>2017-04-21 10:56:13 +0200
commit67a2ba6f993794f1d42808c76f52576a1e82f8d3 (patch)
treebdf27e97788c68aa84f3a58c09fb572b64dc363d
parent79437fa0c9e88ebb0b52d0081ccd07545abf5a08 (diff)
downloadlibssh-67a2ba6f993794f1d42808c76f52576a1e82f8d3.tar.gz
libssh-67a2ba6f993794f1d42808c76f52576a1e82f8d3.tar.xz
libssh-67a2ba6f993794f1d42808c76f52576a1e82f8d3.zip
messages: Fix memory leaks in the ssh_packet_global_request callback
BUG: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1208 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/messages.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/messages.c b/src/messages.c
index 9a06e2a0..8568cbf8 100644
--- a/src/messages.c
+++ b/src/messages.c
@@ -1406,6 +1406,7 @@ SSH_PACKET_CALLBACK(ssh_packet_global_request){
msg->global_request.bind_port);
session->common.callbacks->global_request_function(session, msg, session->common.callbacks->userdata);
} else {
+ SAFE_FREE(request);
ssh_message_queue(session, msg);
return rc;
}
@@ -1426,6 +1427,7 @@ SSH_PACKET_CALLBACK(ssh_packet_global_request){
if(ssh_callbacks_exists(session->common.callbacks, global_request_function)) {
session->common.callbacks->global_request_function(session, msg, session->common.callbacks->userdata);
} else {
+ SAFE_FREE(request);
ssh_message_queue(session, msg);
return rc;
}