sftpserver: Free memory on error condition

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com>
(cherry picked from commit 69c169e4cb)
This commit is contained in:
Jakub Jelen
2025-04-16 16:48:18 +02:00
parent a2bb9b5d0c
commit 573e0e48dc

View File

@@ -1112,6 +1112,7 @@ process_opendir(sftp_client_message client_msg)
sftp_reply_handle(client_msg, handle_s);
ssh_string_free(handle_s);
} else {
free(h);
closedir(dir);
sftp_reply_status(client_msg, SSH_FX_FAILURE, "No handle available");
}