diff options
author | Jeff Layton <jlayton@redhat.com> | 2009-07-20 13:40:52 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-07-20 14:24:37 -0400 |
commit | 90a98b2f3f3647fb17667768a348b2b219f2a9f7 (patch) | |
tree | 784f9cf1728176d7f604fede2ce845cfd6bcf31c | |
parent | 287638b2c533165c3c03dfa15196c2ba583cd287 (diff) |
cifs: free nativeFileSystem field before allocating a new one
...otherwise, we'll leak this memory if we have to reconnect (e.g. after
network failure).
Signed-off-by: Jeff Layton <jlayton@redhat.com>
CC: Stable <stable@kernel.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r-- | fs/cifs/connect.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index e16d7592116a..9bb5c8750736 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -2726,6 +2726,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, | |||
2726 | strncpy(tcon->treeName, tree, MAX_TREE_SIZE); | 2726 | strncpy(tcon->treeName, tree, MAX_TREE_SIZE); |
2727 | 2727 | ||
2728 | /* mostly informational -- no need to fail on error here */ | 2728 | /* mostly informational -- no need to fail on error here */ |
2729 | kfree(tcon->nativeFileSystem); | ||
2729 | tcon->nativeFileSystem = cifs_strndup_from_ucs(bcc_ptr, | 2730 | tcon->nativeFileSystem = cifs_strndup_from_ucs(bcc_ptr, |
2730 | bytes_left, is_unicode, | 2731 | bytes_left, is_unicode, |
2731 | nls_codepage); | 2732 | nls_codepage); |