sftpserver: Free memory on error condition

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com>
This commit is contained in:
Jakub Jelen
2025-04-16 16:48:18 +02:00
parent f0b9db586b
commit 69c169e4cb

View File

@@ -1121,6 +1121,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");
}