mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-27 13:21:11 +03:00
sftp: Fix memory leak in sftp_fstat
When parsing the result of a successful fstat call, make sure to free the resulting reply message. Signed-off-by: Pino Toscano <ptoscano@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
committed by
Andreas Schneider
parent
1ec528b048
commit
bc78383fac
@@ -3189,7 +3189,10 @@ sftp_attributes sftp_fstat(sftp_file file) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (msg->packet_type == SSH_FXP_ATTRS){
|
if (msg->packet_type == SSH_FXP_ATTRS){
|
||||||
return sftp_parse_attr(file->sftp, msg->payload, 0);
|
sftp_attributes attr = sftp_parse_attr(file->sftp, msg->payload, 0);
|
||||||
|
sftp_message_free(msg);
|
||||||
|
|
||||||
|
return attr;
|
||||||
} else if (msg->packet_type == SSH_FXP_STATUS) {
|
} else if (msg->packet_type == SSH_FXP_STATUS) {
|
||||||
status = parse_status_msg(msg);
|
status = parse_status_msg(msg);
|
||||||
sftp_message_free(msg);
|
sftp_message_free(msg);
|
||||||
|
|||||||
Reference in New Issue
Block a user