fs/ntfs3: Fix some memory leaks in an error handling path of 'log_replay()'

All error handling paths lead to 'out' where many resources are freed.

Do it as well here instead of a direct return, otherwise 'log', 'ra' and
'log->one_page_buf' (at least) will leak.

Fixes: b46acd6a6a ("fs/ntfs3: Add NTFS journal")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
Christophe JAILLET 2021-11-11 08:45:44 +01:00 committed by Konstantin Komarov
parent 8bb7eca972
commit e589f9b707
No known key found for this signature in database
GPG Key ID: A9B0331F832407B6

View File

@ -4085,8 +4085,10 @@ process_log:
if (client == LFS_NO_CLIENT_LE) {
/* Insert "NTFS" client LogFile. */
client = ra->client_idx[0];
if (client == LFS_NO_CLIENT_LE)
return -EINVAL;
if (client == LFS_NO_CLIENT_LE) {
err = -EINVAL;
goto out;
}
t16 = le16_to_cpu(client);
cr = ca + t16;