From 9eaa7a63945f6775a8c1850e9af96be30992a5c0 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 13 Jan 2025 14:16:54 +0100 Subject: [PATCH] sftp: Avoid memory leaks from extended attributes Thanks coverity CID 1589433 Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider --- src/sftp_common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sftp_common.c b/src/sftp_common.c index 9116cfe1..71245e61 100644 --- a/src/sftp_common.c +++ b/src/sftp_common.c @@ -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) {