mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user