mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-08 03:42:12 +03:00
sftp: Avoid memory leaks from extended attributes
Thanks coverity CID 1589433 Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -418,6 +418,9 @@ static sftp_attributes sftp_parse_attr_4(sftp_session sftp,
|
||||
(attr->extended_type = ssh_buffer_get_ssh_string(buf)) &&
|
||||
(attr->extended_data = ssh_buffer_get_ssh_string(buf))) {
|
||||
attr->extended_count--;
|
||||
/* just ignore the extensions -- we can't interpret them */
|
||||
SSH_STRING_FREE(attr->extended_type);
|
||||
SSH_STRING_FREE(attr->extended_data);
|
||||
}
|
||||
|
||||
if (attr->extended_count) {
|
||||
|
||||
Reference in New Issue
Block a user