summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2009-07-20 13:40:52 -0400
committerSteve French <sfrench@us.ibm.com>2009-07-20 18:24:37 +0000
commit90a98b2f3f3647fb17667768a348b2b219f2a9f7 (patch)
tree784f9cf1728176d7f604fede2ce845cfd6bcf31c /fs/cifs
parent287638b2c533165c3c03dfa15196c2ba583cd287 (diff)
downloadop-kernel-dev-90a98b2f3f3647fb17667768a348b2b219f2a9f7.zip
op-kernel-dev-90a98b2f3f3647fb17667768a348b2b219f2a9f7.tar.gz
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>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/connect.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index e16d759..9bb5c87 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2726,6 +2726,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
strncpy(tcon->treeName, tree, MAX_TREE_SIZE);
/* mostly informational -- no need to fail on error here */
+ kfree(tcon->nativeFileSystem);
tcon->nativeFileSystem = cifs_strndup_from_ucs(bcc_ptr,
bytes_left, is_unicode,
nls_codepage);
OpenPOWER on IntegriCloud