1
0
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:
Jakub Jelen
2025-01-13 14:16:54 +01:00
parent 4af88c84d4
commit 9eaa7a6394

View File

@@ -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) {