From: Steve French Date: Sat, 22 Mar 2008 22:57:44 +0000 (+0000) Subject: [CIFS] Fix mem leak on dfs referral X-Git-Tag: v2.6.25-rc7~31^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04b6e6ec1a9340ab77637cae9b51b984d9d706d8;p=linux-2.6 [CIFS] Fix mem leak on dfs referral Signed-off-by: Igor Mammedov Signed-off-by: Steve French --- diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 7e4c244917..bc673c8c1e 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -211,7 +211,10 @@ try_again_CIFSSMBUnixQPathInfo: if (rc) { if (rc == -EREMOTE && !is_dfs_referral) { is_dfs_referral = true; - full_path = search_path; + if (full_path != search_path) { + kfree(full_path); + full_path = search_path; + } goto try_again_CIFSSMBUnixQPathInfo; } goto cgiiu_exit; @@ -422,7 +425,10 @@ try_again_CIFSSMBQPathInfo: if (rc) { if (rc == -EREMOTE && !is_dfs_referral) { is_dfs_referral = true; - full_path = search_path; + if (full_path != search_path) { + kfree(full_path); + full_path = search_path; + } goto try_again_CIFSSMBQPathInfo; } goto cgii_exit;